Re: Send files from iphone
Re: Send files from iphone
- Subject: Re: Send files from iphone
- From: Development <email@hidden>
- Date: Fri, 3 Jul 2009 20:29:44 -0700
I also tried this and it fails. The form never gets any post variables
or files:
[self sendText:@"Content-Type: multipart/form-data; boundry=@@##$$-
rew-**&&^%^\n"];
[self sendText:boundry];
[self sendText:[NSString stringWithFormat:@"Content-Length: %i\n
\n",totalSize]];
[self sendText:[NSString stringWithFormat:@"Content-Disposition: form-
data; name=\"%@\"\r\n\r\n",@"fileName"]];
[self sendText:[NSString stringWithFormat:@"%@",name]];
[self sendText:boundry];
[self sendText:[NSString stringWithFormat:@"Content-Disposition: form-
data; name=\"%@\"\r\n\r\n",@"directory"]];
[self sendText:[NSString stringWithFormat:@"%@",dir]];
[self sendText:boundry];
[self sendText:[NSString stringWithFormat:@"Content-Disposition: form-
data; name=\"imagefile\" filename=\"%@\"\r\n",name]];
[self sendText:@"Content-Type: application/octet-stream\r\n\r\n"];
[self sendData:imageData];
[self sendText:boundry];
On Jul 3, 2009, at 8:00 PM, Luke Hiesterman wrote:
Check out documentation on NSURLRequest and NSURLConnection.
Luke
Sent from my iPhone.
On Jul 3, 2009, at 7:20 PM, Development
<email@hidden> wrote:
I need to be able to upload the data from a UIImage to a server via
http POST however I simply cannot find a good example of how to
arrange the headers or how to make this post.
The only data I need to send to the server is the file's name, the
user's name and the data itself and I simply cannot seem to get it
to work. Can any of you offer a helping hand?
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden