• 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
Re: File Uploading to HTTP server using CFHTTPMessage API fails
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: File Uploading to HTTP server using CFHTTPMessage API fails


  • Subject: Re: File Uploading to HTTP server using CFHTTPMessage API fails
  • From: DEBAPRIO BANIK <email@hidden>
  • Date: Fri, 13 Jan 2012 11:37:11 +0530

Hi Jens,

Unable to find any API's for setting the headers of the http request with NSURL.
Why API's for uploading the file to the server needs to go through NSInputStream? Its output from client perspective. So
isn't the API's are bit odd !

If you have any sample code where a http request is created, body is set and send to the server, will be great help.

With Regards

On Fri, Jan 13, 2012 at 11:25 AM, Jens Alfke <email@hidden> wrote:

On Jan 12, 2012, at 9:37 PM, DEBAPRIO BANIK wrote:

I cannot point the input stream to a file. The request body should have the bytes for the XML followed by the file data bytes.
Can i create a temporary file appending XML bytes and file data bytes and the point the input stream to that file.

[First, please reply to the list, not just to me.]

The option you suggest will work, but it’ll be slow for large files. If you don’t care about large files, you might as well just assemble the response data in memory and set it as the HTTPBody property.

If you do need to handle huge files and don’t want to copy the file, you could create your own NSInputStream subclass that when read first returns the XML data, and then opens a private input stream on the file and returns data from that.

—Jens

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: File Uploading to HTTP server using CFHTTPMessage API fails
      • From: Jens Alfke <email@hidden>
References: 
 >File Uploading to HTTP server using CFHTTPMessage API fails (From: DEBAPRIO BANIK <email@hidden>)
 >Re: File Uploading to HTTP server using CFHTTPMessage API fails (From: Jens Alfke <email@hidden>)
 >Re: File Uploading to HTTP server using CFHTTPMessage API fails (From: Jens Alfke <email@hidden>)
 >Re: File Uploading to HTTP server using CFHTTPMessage API fails (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: File Uploading to HTTP server using CFHTTPMessage API fails
  • Next by Date: Re: File Uploading to HTTP server using CFHTTPMessage API fails
  • Previous by thread: Re: File Uploading to HTTP server using CFHTTPMessage API fails
  • Next by thread: Re: File Uploading to HTTP server using CFHTTPMessage API fails
  • Index(es):
    • Date
    • Thread