• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
converting image file on disk to NSString for use in HTTP request
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

converting image file on disk to NSString for use in HTTP request


  • Subject: converting image file on disk to NSString for use in HTTP request
  • From: "Thomas Haynes" <email@hidden>
  • Date: Mon, 2 Jul 2007 16:57:41 -0700

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


  • Follow-Ups:
    • Re: image file on disk - use in HTTP request
      • From: Wain Glaister <email@hidden>
  • Prev by Date: NSPopupButton in main window changes when NSUserDefaultsController adds/removes item in Preference Pane
  • Next by Date: Cocoa Framework for accessing images on USB digital camera
  • Previous by thread: Re: NSPopupButton in main window changes when NSUserDefaultsController adds/removes item in Preference Pane
  • Next by thread: Re: image file on disk - use in HTTP request
  • Index(es):
    • Date
    • Thread