Re: image file on disk - use in HTTP request
Re: image file on disk - use in HTTP request
- Subject: Re: image file on disk - use in HTTP request
- From: Wain Glaister <email@hidden>
- Date: Tue, 3 Jul 2007 20:01:57 +0100
Hi,
You don't send a string and the server doesn't need to 'understand'
the data, all you are sending is the raw image data so try: + (id)
dataWithContentsOfFile:(NSString *)path and append it to the rest of
the data that you are giving to the URL request.
Wain
On 3 Jul 2007, at 00:57, Thomas Haynes wrote:
Hi there.
I'm using NSMutableURLRequest to send HTTP requests to a script that
handles a multipart form. One part of that form is an image uploader,
so I'm sending
------WebKitFormBoundaryFo/VfTYBSYwX2yJD
Content-Disposition: form-data; name="imagefile"; filename="2.jpg"
Content-Type: image/jpeg
<<image data here>>
because that's what I see the form actually POSTing when I use my
sniffer to watch the request. The only thing is that I can't figure
out the right way to get from the file I have on disk to the <<image
data here>> part. When I watch the image in the sniffer, I can read
the camera type and some other information, and then it's just
gibberish (obviously). But how do I create my own gibberish that the
HTTP server can understand?
Thanks.
Tom Haynes
--
Tom Haynes
(713) 826 4175
_______________________________________________
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