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 <developm...@fornextsoft.com> 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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/luketheh%40apple.com

This email sent to luket...@apple.com

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to