Quote:
Originally Posted by jcafaro10
Thanks for the response. What makes mine asynchronous and yours synchronous? I just got my download code from the apple website. Is one way better than the other?
|
I'm using
sendSynchronousRequest:, you're using
initWithRequest:. In mine, it will sit in that method until it's done. Which is not a good thing for a large transfer, but mine is quite small. For a fair amount of data, yours is better.
Quote:
Originally Posted by jcafaro10
Also looking at the code, it looks like you're making a string out of your login information and some other strings. What does that actually do? I don't really understand how a lot of this works. I need to actually upload a file.
|
That's the actual data. Does it really need to be a file when it gets to the server, or is your server side going to read the data and do something with it? How are you creating the file on the phone in the first place?
There are ways to encode actual files into an POST request, but you'll need to look up the appropriate parameters to set in the NSURLRequest object. It's much more complicated. I found this example with a quick Google search:
Cocoabuilder - (Ben Lachman) Re: File upload with NSURLRequest fails
joe