Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

streaming upload of a file



I am using CFNetwork to upload files using HTTP POST multipart/form-data requests. This works fine for small files, but I would like to be able to upload larger files without having to read the entire file into memory in order to create the body of the request. 
 
Currently, since the body of my request has to include both the file data and the form data (boundary strings, etc.). I create a buffer, fill it with the form elements and file data, call CFReadStreamCreateWithBytesNoCopy to get a stream from the buffer, and then call CFReadStreamCreateForStreamedHTTPRequest to make my request. 
 
What I would like to do is get a stream to the file (with CFReadStreamCreateWithFile, presumably) and create the request from that stream, without reading the file into memory. The problem is that if the file stream is used as the body of the request, I can't include other any data in the body, like the form elements. Is there any way to stream in the file as part of the body of the request, but still add other data?
 
 
-Tracy

 

 

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/macnetworkprog/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.