I need to be able to send a file to another website from server-side Classic ASP code. The other website has a form with a file upload control, and I need to simulate posting to this form.
I found some sample code which seemed perfect for the job here, and it uploads the file without error, but the received file is not valid and when I inspect it on the other server the beginning of the file before the binary data has part of the posted data in it that shouldn’t be there, eg:
ntent-Type: image/jpeg
Content-Disposition: form-data; name=”file”; filename=”archivebox.jpg”ÿØÿà…
The receiving website code works fine when I upload data via a form, so it definately looks like the problem is with the above code.
If this code is not going to work, can anyone else point me in the direction of another sample for submitting files in this way?
Using the code sample in the link in my question, I modified it to build the request manually and it worked. I also converted to a single function that takes a binary file and one parameter and POSTs the request.