BEGINFUNCTIONS FUNCTION InitPostData file boundary SET %myfile = file SET %myboundary = "--" & boundary SET %contenttype = "multipart/form-data; boundary=" & boundary WRITEFILE file %myboundary ENDFUNCTION FUNCTION AddPostField name value SET %header = 'content-disposition: form-data; name="' & name & '"' WRITEFILE %myfile %header /append WRITEFILE %myfile "" /append WRITEFILE %myfile value /append WRITEFILE %myfile %myboundary /append RETURN ENDFUNCTION FUNCTION AddPostFile fieldName file mimeType SETSUBSTR depth = file "\" SETNUM depth = depth + 1 SETEXTRACT base = file "\" depth SET %header = 'content-disposition: form-data; name="' & fieldName & '"; filename="' & base & '"' SET %mimeHeader = 'Content-Type: ' & mimeType SET %headFile = %myfile & ".head" SET %tailFile = %myfile & ".tail" WRITEFILE %myfile %header /append WRITEFILE %myfile %mimeHeader /append WRITEFILE %myfile "Content-Transfer-Encoding: binary" /append WRITEFILE %myfile "" /append RENAME %myfile %headFile WRITEFILE %tailFile %myboundary SET %command = "copy /b " & %headFile & " + " & file & " + " & %tailfile & " " & %myfile DOSCMD %command DELETE %headFile DELETE %tailFile ENDFUNCTION ENDFUNCTIONS ;; You should not need to edit anything above this line. ;; Just set the variables below as appropriate and call ;; the above functions as demonstrated below. SET %tmpdata = "C:\post.bin" SET %field1 = "field1 value" SET %field2 = "field2 value" SET %filename = "C:\files\files.zip" ; mimetype below should be based on extension (zip) SET %mimetype = "application/zip" ; see http://www.mimetype.org/ or use application/octet-stream FTPLOGON "HTTP Site" ; prepare post data for upload InitPostData %tmpdata "lakfiqalwuFieldSeperator48pyq489p" AddPostField "field1" %field1 AddPostField "field2" %field2 AddPostFile "userfile" %filename %mimetype HTTPPOST "/poster.asp" %tmpdata %postresult /outtype=string /contenttype=%contenttype DELETE %tmpdata FTPLOGOFF