[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Multipart form data
I ran into an issue when posting multipart form data. I was using the
http_mfd_encoder_addstmf procedure like this:
http_mfd_encoder_addstmf( enc
: 'File'
: '/MyFolder/MyFile.txt'
: 'text/plain');
This produced a heading that looked like this:
---httpapi-2009-06-16-14.31.46.355
Content-Disposition: form-data; name="File";
filename="/MyFolder/MyFile.txt"
Content-Type: text/plain
Having the entire path in the file name was unacceptable to the site I
was posting to. In addition, I wasn't very happy with the idea of
posting my directory structure to an outside source. Therefore I
added a fifth optional parameter to http_mfd_encoder_addstmf. Now I
can pass the file name I want to send. So now my call looks like
this:
http_mfd_encoder_addstmf( enc
: 'File'
: '/MyFolder/MyFile.txt'
: 'text/plain'
: 'SendingName');
Resulting in a heading that looks like this:
---httpapi-2009-06-16-14.31.46.355
Content-Disposition: form-data; name="File"; filename="SendingName"
Content-Type: text/plain
I would like to propose that this change be incorporated into
HTTPAPI.
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------