Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords:
May fail for some old text-only browsers (Lynx) that do not supply filenames.
Returns @FALSE if no file was specified
;;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #DefineFunction udf_GetUploadFileName() ; this_dir=DirGet() ; DebugTrace(@ON, StrCat(this_dir, "webbatch_debug_GetUploadFileName.txt")) ;; Buffer the Multi-part form info. bbsize=WebConSize() binbuf=BinaryAlloc(bbsize) WebConBuf(binbuf) index = BinaryIndex(binbuf, 0, "Content-Type:", @FWDSCAN ) ;; Find the position of "Content-Type:" ;; Use index for content-type, scan back until the filename=" and then extract the text in between. If (index>0) fnindex = BinaryIndex( binbuf, index, "filename=", @BACKSCAN) linelength = index-fnindex ;; Crop off 'filename="' from initial position with +10 and remove the '"@CRLF' from the end with -13 linedata=BinaryPeekStr(binbuf, fnindex+10, linelength-13) Else linedata=@FALSE Endif binbuf=BinaryFree(binbuf) Return linedata #EndFunction
Article ID: W15370
File Created: 2003:05:13:11:27:20
Last Updated: 2003:05:13:11:27:20