RESTframework icon indicating copy to clipboard operation
RESTframework copied to clipboard

Can't upload a file

Open dyaacov opened this issue 13 years ago • 0 comments

Hi, I'm trying to upload a file from my iPhone ios 6. In wireshark, I see that the data is missing, I only see Content-Disposition and Content-Type but no data. Content-Disposition: form-data; name="file"; filename="mypic.jpeg"\r\n Content-Type: image/jpeg\r\n\r\n and after that - NOTHING

Here is my code: RFRequest* r = [RFRequest requestWithURL:[NSURL URLWithString:url] type:RFRequestMethodPost bodyContentType:RFRequestBodyTypeMultiPartFormData resourcePathComponents:nil];

//add files...
NSData *data = UIImageJPEGRepresentation(self.selectedImage, 1.0);
[r addData:data withContentType:@"image/jpeg" forKey:@"mypic.jpeg"];

dyaacov avatar Jan 26 '13 09:01 dyaacov