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