Darrell Young wrote:
I have seen examples that create multipart posts, but takes performance hits as the files get larger, because the files are loaded into memory and base64 encoded and added to the mulitpart post before being put into nsIUploadChannel.

See the code in nsFormSubmission.cpp, in particular the implementation of nsFSMultipartFormData::AddNameFilePair [1] and nsFSMultipartFormData::Init [2]. This code is using nsIMultiplexInputStream [3], which lets you multiplex several streams (eg your string stream for most of the form data, the file's input stream, and some more string stuff).


-Boris

[1] http://lxr.mozilla.org/seamonkey/source/content/html/content/src/nsFormSubmission.cpp#767
[2] http://lxr.mozilla.org/seamonkey/source/content/html/content/src/nsFormSubmission.cpp#820
[3] http://lxr.mozilla.org/seamonkey/source/xpcom/io/nsIMultiplexInputStream.idl
_______________________________________________
Mozilla-netlib mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-netlib

Reply via email to