Add support for multipart upload in NSMutableURLRequest

Originator:ddribin
Number:rdar://5294279 Date Originated:25-Jun-2007 07:19 PM
Status:Open Resolved:
Product: Product Version:
Classification: Reproducible:
 
25-Jun-2007 07:19 PM Dave Dribin:
Summary: 
The URL downloading system does not have support for multipart POST upload directly.  It is possible to do this manually, by creating the multipart body inside an NSData instance, and then setting the body of an NSMutableURLRequest.  However, there are a number of issues:

1) It's a pain to create the multipart body.  You have to become very familiar with RFC 2046 in order to do it correctly.
2) If the body is created in an NSData, then the whole body must exist in memory.  For uploads of large files, this can be impractical.
3) In order to get around issue 2, I tried to create an NSInputStream subclass.  Unfortunately, it is not possible to use an NSInputStream subclass with NSURLConnection, as per this discussion thread:

<http://lists.apple.com/archives/Macnetworkprog/2007/May/msg00051.html>

Steps to Reproduce: 
N/A

Expected Results: 
N/A

Actual Results: 
N/A

Regression: 
N/A

Notes: 
N/A

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!