views:

32

answers:

1

Hi, I want to sent post request, but i need to send multiple files, how to do this?

tnx

+1  A: 

Use one of the many resources on how to configure an NSMutableURLRequest for POSTing data. The Content-Type header should be "multipart/form-data", and each file will be concatenated in turn with an appropriate part header. RFC2388 is the relevant standard.

warrenm
Each file need to be NSData?
donodare
That's probably the way to do it, especially if you're transmitting binary data. Just accumulate the body of the request in an NSMutableData and append the file data where appropriate.
warrenm
You mean all the files will be in one NSMutableData?How the server will separate them?What i need to do?
donodare