I'm totally watching this thread, i'm working on a project thats
going to require the exact same thing!
Fingers crossed someone helps us out :D
- az
On 16/05/2007, at 1:35 AM, Dave Dribin wrote:
Hello,
I've been working on an NSInputStream subclass so I can POST a
large file without loading the entire file into memory. I'm
currently building the entire multipart/form-data body using
NSMutableData, and passing this to -[NSMutableURLRequest
setHTTPBody:]. The downside to this approach is that the entire
HTTP body is resident in memory.
I noticed that the body of NSMutableURLRequest can alternately be
set using setHTTPBodyStream:. I figured if I can subclass
NSInputStream, I could achieve my goal. According to the
NSInputStream doc [1], a subclass needs to override three methods
read:maxLength:, getBuffer:length:, and hasBytesAvailable.
I've done this, and from my unit tests, it seems that I'm doing
everything correct. However, when I try to use my stream in an
NSURLConnection, I get the following runtime error:
*** -[DDMultipartInputStream _scheduleInCFRunLoop:forMode:]:
selector not recognized [self = 0x3062b0]
I found a message on the list from 2005 citing "problems with
subclassing
NSInputStream that may prevent it from working":
_______________________________________________
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/d2kagw%
40gmail.com