How to upload a image to server using ASIFormDataRequest ?
i tried to upload a image its does't show's any error while inserting. and in my requesting did finished method iam getting response as success. so what is the problem is, when i get the data what i have inserted in that i am not able to get the image what i have inserted but iam getting the image path also.
here is my code
NSString *globalurl =[[NSUserDefaults standardUserDefaults]valueForKey:#"Global_Url"];
NSString *urlStr=[NSString stringWithFormat:#"%#/InsertUserInfo?User_Name=%#&User_Pwd=%#&User_FName=%#&User_LName=%#&User_Mail=%#&User_Phno=%#&User_Address=%#&User_Dob=%#&Ic_No=%#&User_Active=%#&User_Questions=%#&User_Ans=%#",globalurl,usernameTxtFld.text,pwdTxtFld.text,firstName.text,lastName.text,email.text,phonNO.text,address.text,dateOfbirth.text,nricNo.text,#"10001",#"",#""];
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:[NSURL URLWithString:urlStr]];
[request setRequestMethod:#"POST"];
[request setDelegate:self];
[request addData:dataImage withFileName:#"Image.png" andContentType:#"image/png" forKey:#"photo"];
//check if passedData is nil
if (dataImage == nil)
{
UIAlertView *alert=[[UIAlertView alloc]initWithTitle:#"title:iDnil" message:#"nil" delegate:nil cancelButtonTitle:#"fgff" otherButtonTitles:#"erer", nil];
[alert show];
}
[request startAsynchronous];
-(void)requestFinished:(ASIHTTPRequest *)request {
NSString *receivedString = [request responseString];
NSLog(#"received messge %#",receivedString);
UIAlertView *alertView = [[UIAlertView alloc]initWithTitle:#"Message" message:receivedString delegate:nil cancelButtonTitle:#"Ok" otherButtonTitles:nil];
[alertView show];
}
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
dataImage = UIImageJPEGRepresentation([info objectForKey:#"UIImagePickerControllerOriginalImage"],1);
NSLog(#"dict is %#",info);
UIImage *image=[info objectForKey:UIImagePickerControllerOriginalImage];
[self dismissModalViewControllerAnimated:YES];
}
You can use
[request setFile:#"YOUR IMAGE FILE PATH" forKey:#"photo"];
instead of [request addData:dataImage withFileName:#"Image.png" andContentType:#"image/png" forKey:#"photo"];
as explained in the post . It worked for me like a charm :-)
I have uploaded an example application performing textfile, Image, Video, Images upload in queue, Videos to GitHub on this link. You may well consider having a look at it.
ASI-http-request has an optimisation option to stream your image files right away from your disk, which is the best I've seen with this library. Please consider using the below code snippet for creating ASIFormDataRequest.
// Initilize Variables
NSURL * url = [NSURL URLWithString:IMAGE_POST_URL];
// Add Image
NSString *path = [[NSBundle mainBundle]pathForResource:#"image1" ofType:#"jpg"];
// Get Image
NSData *imageData = [[NSData alloc]
initWithContentsOfFile:path];
// Return if there is no image
if(imageData != nil){
//Request-1
ASIFormDataRequest * request1;
[request1 setTag:201];
request1 = [[ASIFormDataRequest alloc] initWithURL:url];
[request1 setPostValue:#"ID = 201" forKey:#"image_upload"];
[request1 setFile:path forKey:#"image1_file"];
[request1 setDelegate:self];
[request1 setDidFinishSelector:#selector(imageUploadDidFinish:)];
[request1 setDidFailSelector:#selector(imageUploadDidFail:)];
[request1 setTimeOutSeconds:500];
[request1 setShouldStreamPostDataFromDisk:YES];
}
Related
Hi I just used image picker view to record a video and convert the video formate mov to mp4 and change NSData for posting. But it is not working I get 415 error some times 500 errors. Please check below code for how I implemented. Anybody can guid or help me for this issue.
if I need to check my server side team , they test with postman it is working well when I am implement of below code it is not working if may did any mistakes please guid me thank you
-(void)camerabuttonHandlerqas{
UIAlertController * picker = [UIAlertController alertControllerWithTitle:#"Pick an image using" message:nil preferredStyle:UIAlertControllerStyleActionSheet];
UIImagePickerController * imagePicker = [[UIImagePickerController alloc]init];
imagePicker.delegate = self;
UIAlertAction* cancel = [UIAlertAction actionWithTitle:#"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction * action) { }];
UIAlertAction* takeVideo = [UIAlertAction actionWithTitle:#"TakeVideo" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePicker.mediaTypes = [[NSArray alloc] initWithObjects: (NSString *) kUTTypeMovie, nil];
imagePicker.view.tag = 100;
[self presentViewController:imagePicker animated:YES completion:nil]; }];
[picker addAction:picture];
[picker addAction:cancel];
picker.view.tintColor = [UIColor grayColor];
[self presentViewController:picker animated:YES completion:nil];
}
#pragma mark - <UIImagePickerControllerDelegate>
-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary<NSString *,id> *)info {
videoURL = info[UIImagePickerControllerMediaURL];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString* videoPath = [NSString stringWithFormat:#"%#/test_%d.mp4", [paths objectAtIndex:0],arc4random_uniform(1000)];
NSURL *outputURL = [NSURL fileURLWithPath:videoPath];
[self convertVideoToLowQuailtyWithInputURL:videoURL outputURL:outputURL handler:^(AVAssetExportSession *exportSession)
{
switch (exportSession.status) {
case AVAssetExportSessionStatusFailed:
NSLog(#"status failed");
break;
case AVAssetExportSessionStatusCompleted:{
NSLog(#"status success %# ",videoPath);
NSMutableDictionary *data = [NSMutableDictionary new];
videoURL = info[UIImagePickerControllerMediaURL];
[data setObject:[self generatePostDataForData:[NSData dataWithContentsOfFile:videoPath]] forKey:#"SelectedvideoURL"];
imagePickerIsSelected = YES;
[self postData:data];
break;
}
}];
[picker dismissViewControllerAnimated:YES completion:nil]; }
- (NSData *)generatePostDataForData:(NSData *)uploadData
{ // Generate the post header:
NSString *post = [NSString stringWithCString:"--AaB03x\r\nContent-Disposition: form-data; name=\"upload[file]\";
filename=\"somefile\"\r\nContent-Type: application/octet-stream\r\nContent-Transfer-Encoding: binary\r\n\r\n" encoding:NSASCIIStringEncoding];
// Get the post header int ASCII format:
NSData *postHeaderData = [post dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
// Generate the mutable data variable:
NSMutableData *postData = [[NSMutableData alloc] initWithLength: [postHeaderData length] ];
[postData setData:postHeaderData];
// Add the image:
// Add the closing boundry:
[postData appendData: [#"\r\n--AaB03x--" dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES]];
// Return the post data:
return postData;
}
-(void) postData:(NSData *)data
{
service = [NSString stringWithFormat:#"http://1.1.1.1:8080/testing/postapi/photoUpload/uploadVideo?videoName=video_%d&type=mp4",arc4random_uniform(1000)]
delegate = delegateInstance;
service = [service stringByAddingPercentEncodingWithAllowedCharacters: [NSCharacterSet URLFragmentAllowedCharacterSet]];
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init];
[request setURL:[NSURL URLWithString:service]];
[request setCachePolicy:NSURLRequestReloadIgnoringLocalCacheData];
[request setHTTPShouldHandleCookies:NO];
[request setTimeoutInterval:60];
[request setHTTPMethod:#"POST"];
// set Content-Type in HTTP header
[request setValue:#"mp4/MOV" forHTTPHeaderField: #"Content-Type"];
NSMutableData *body = [NSMutableData data];
// add image data
if (videoData) {
[body appendData:videoData];
}
// setting the body of the post to the reqeust
[request setHTTPBody:videoData];
// set URL
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(#"%#", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(#"%#", httpResponse);
} }]; [dataTask resume]; }
415 error media type error check your server data type on which u r storing NSDATA.
I got solution that code is absolutely right and no need to change media type to mp4 if server side accept .mov type and please discuss with server side then have to change content type, and take file like as a one data then its working for me
Thank you.
I am uploading Image to server. Length Of NSData will depend On the size of image. if image is too big, NSData length will be 6798791 (length will vary). if image is small Request is getting Uploaded to server. if request it too big (Contains very big image) request is not getting uploaded. Below is request format of an image.
<vaayoo:message xmlns:vaayoo="http://www.vaayoo.com<vaayoo:ostype>iphone</vaayoo:ostype><vaayoo:osversion>8</vaayoo:osversion><vaayoo:deviceid>354043043430851</vaayoo:deviceid><vaayoo:sku>lite</vaayoo:sku><vaayoo:xmlversion>1.0</vaayoo:xmlversion></vaayoo:header><vaayoo:vaayoodata xmlns:vaayoo="http://www.vaayoo.com/version2/yooml" datatype="content" mobiletid="8DD7A158-FC05-4588-B4D6-39D93F10E504" formname="frm_reportupload" streamid="A58BFEAF-E566-4ddc-842D-F8C5976FC300"><vaayoo:event type="control_click" name="btn_submit"><vaayoo:action type="form.asyncsubmit" url="http://content.vaayoo.com/AppsPlatForm/PhotoReportCreatorService/PhotoReportCreator.svc/PhotoreportResponse" asyncurl="http://content.vaayoo.com/AppsPlatForm/ConentUploadService/1_1/MyuploadService.svc/UploadData"/></vaayoo:event><vaayoo:data type="formdata" collection="true"><vaayoo:input name="img_0" type="image" filename="01262013035548648.jpg" currentchunk="18" totalchunk="18">VJpLnKnCzUkRBniTapLDOck81q6dqysPLl4ANZEod5Pl+Zc/d6Gq5Em4hsAdRg0+dyak0ZxpN+82aV8xYmQNu5wAelZkmZXGRUjySOFAycDmlJwMtx3qZS0aGmr7DPsciAYI2rz70qTMhBDfNnkelWbV9zHcd2Rj61ObEDeeFXGaty90qVrWRSfBwQmO/NIY2Bxn5e5JqRsKCTyW45oIGBu5B5qE2277hBaFV+WxI2D2xTHmXeSnJHU1OwjkU7idoHbrWfOCqZTjPercJNXbLi5XsSR3BdnLA7j0PtRNHuUOuA5NRRMwIQ4HHJqx8rbQDnHGa54q7bDkk9UyrE5DYJywOetWZ7nLkYLZ4yRxU4hjOcJlh1NIUk3Y2Db0Hc10L3naRN+XRsDcPlWHIxiprWUNEGPVjkiqiOIQyt1PUDrU8Z/d7lwR2BrKXYfK+VO5YdHdVKkb93QnFShdiBnHzE4zUEH77/WHLA529BU0m1PmPzA/Nz/KtYK8eVkadtSRopHjwTkEcdjVa5g2/vJGAVFq4LtNyknC4pk9uJhnqG9KrmcWuZmjmkldFUuGhG45BGd3Uj2qtH8rb87h2NPlDR5VRtTOAtNTEKBCMKTx7VUZRlFsvm59yR3xy7FgaSWYrFtiBU+tICsnyYJYH8KbIGMhOOhHFZOXLqyNL36ldoX8kM+EI5ODk/jUtndG33buQRxRkwKVlBRvQ07yvM2zcjHHSos5XsVK8hWbziPMcAdeBU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xLk7F6fjWiSVmctSTjLkexgEvE4IXd81SrLztZcc5471au4GMhAPHQEVTnYRbVK5I6tS5VfQ2vdNxWgNaKwJHB60kdy/KYBwOeKazuwG0/JnOc9aglQjc/r2zSUnHVmcZNa2LwCTOiueevFJPnay8bQaobiH3qxBxwpNTSzloWGAWUZypquaN7s6YxVncrTokhC52kHPFSBh5zKxzhcikj/eZIPNDRrK6kghweOwNZ6sqTXK31K7y7ZMqDjH3RSy/OyHoD19RU7W6SL8jlSB1NVizAmMr0OMjvUuxipe8uYdcnY8TM2QeT61ahuAgyR8jDgDtWZdsyyRjGTnAqd5WhAbHy9D709Zajc002izHKs0hCqAR1qaCZwzcY5/Cq1uyGE4ypPcCh7sZ2DhDxVcu1yrJe8aNwPOCYOfYdqkjlfegjjJPcg9KrWxKRnzGwW4XHpVmNRnIJLVfKudpmEmlqbcBXYqjBZ+pz0qlfRXOWGEwp6g5yKjJMYDAFSe4qUaiJEc7cnBBPY1e5lzXlZGLcQKrIwJbcM88Gq8twWxEQSnvVu5mLyAP1zge1ZV022XYGxzwRzUp62Z0StJX2NBkWNgF4OM59KgLEvhj9G9ajE0e1v3jNJjaB0FTLNHJGFIzt/nUWSVkZxl3YkjtGqBTjk5pplzEFBy2eSaSWYgBwgaNjjk4qs0w8zPCqR0HIpe7G9zT4viLJnSKE4bLdaybskl5Eycnt1NMuLvDEDBX9aghuiW/uHtVW05kTb2istEOluPPUZG3jvUFq4ILFvkHy4p7fv3JJyajZBCCzD5OpA9ajnjJq25cocsk+x//Z</vaayoo:input><vaayoo:input name="txt_rpt_name" type="text" textmode="multiline">anil dairy</vaayoo:input></vaayoo:data></vaayoo:vaayoodata></vaayoo:message>
Below is the method which is writing the data to server.
-(BOOL)write:(NSData *)data toURI:(NSString *)URI
{
BOOL retVal = NO;
NSString* requestDataLengthString = [[NSString alloc] initWithFormat:#"%d", [data length]];
NSLog(#"Data length is %#",requestDataLengthString);
NSLog(#"Urlis %#",URI);
NSRange range = [URI rangeOfString:#"http"];//Is http?
if(range.location != NSNotFound)
{
//Yes, http
NSMutableURLRequest *httpRequest = [[NSMutableURLRequest alloc] initWithURL: [NSURL URLWithString:URI]];
[httpRequest setHTTPMethod:#"POST"];
[httpRequest setHTTPBody:data];
[httpRequest setValue:#"application/xml" forHTTPHeaderField:#"Content-Type"];
[httpRequest setValue:requestDataLengthString forHTTPHeaderField:#"Content-Length"];
NSURLConnection *theConnection=[[NSURLConnection alloc] initWithRequest:httpRequest delegate:self];
[theConnection release];
[httpRequest release];
if (theConnection)
{
receivedData=[[NSMutableData data] retain];
retVal = YES;
}
else
{
NSError *error = [NSError alloc];
NSLog(#"Connection failed! Error - %# %#",
[error localizedDescription],
[[error userInfo] objectForKey:NSURLErrorFailingURLStringErrorKey]);
[error release];
retVal = NO;
}
}
return retVal;
}
What am i doing wrong in Write method ? it works fine for small images, but doesn't work for bigger images, not even getting any kind of exception if i try to upload big images. How to troubleshoot this problem. Help me out plz.. Thanks in advance..
Have you tried using the asynchronous upload with NSURLConnection delegates? Probably the error might show up there. What language are you using for the webservice? It could be the setting on your webserver that makes it fail to upload big image. Try to see the maximum request length that is set on your server. If it's smaller than the image size, then it would fail.
Use NSTimeoutInterval and try its working:
NSMutableURLRequest *request1 = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:urlString] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:1000.0];
Instead of using:
[httpRequest setHTTPBody:data];
Use:
NSInputStream *stream = [[NSInputStream alloc] initWithFileAtPath:filePath];
request setHTTPBodyStream:stream];
Apple has an example of this.
I am trying to make a basic authentication system in iOS that sends a POST to Django and on the Django side authenticates the user and starts a session. Right now I am able to send the user information by passing the values as data in the URL and authenticating it, but how do I retrieve the session data or cookie from the Django response? When I try to store or print out the cookie, it tells me the array is empty. I have tried both request.requestCookies and request.responseCookies.
NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:#"test_user", #"username", #"pass", #"password", nil];
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:#"http://127.0.0.1:8000/login/"]];
NSError *error;
NSData *data = [NSJSONSerialization dataWithJSONObject:dict options:0 error:&error];
if ( error ) {
NSLog( #"ERROR - %#", error.localizedDescription );
} else {
__block ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
[request addRequestHeader: #"Content-Type" value:#"application/json; charset=utf-8"];
[request appendPostData:data];
[request setRequestMethod:#"POST"];
[request setCompletionBlock:^{
UIAlertView *alerView = [[UIAlertView alloc] initWithTitle:#"Login"
message:#"Login was sent"
delegate:nil
cancelButtonTitle:nil
otherButtonTitles:#"Ok", nil];
[alerView performSelectorOnMainThread:#selector(show) withObject:nil waitUntilDone:NO];
NSLog(#"RESPONSE: %#", [[NSString alloc] initWithData:request.responseData encoding:NSUTF8StringEncoding]);//, [request.requestCookies objectAtIndex:0]);
NSLog(#"COOKIE: %#", [request.requestCookies objectAtIndex:0]);
[ASIHTTPRequest addSessionCookie:[request.requestCookies objectAtIndex:0]];
}];
Okay, so I resolved this issue and it turns out that on the server side I was putting in the data but not officially logging in with Django (was not returning the proper cookies) which meant my app was not receiving the proper header.
Hello good morning everyone. I am using asihttprequest for a series of images download - 4 images from server.However i noticed an issues and cannot find a solution. Suppose i am downloading 4 images via URL and in case any one or 2 of the images is not available it cancels the whole queue.
Here is my code :
[networkQueue setDownloadProgressDelegate:progressIndicator];
[networkQueue setRequestDidFinishSelector:#selector(imageFetchComplete:)];
[networkQueue setRequestDidFailSelector:#selector(imageFetchFailed:)];
request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:#"http://imagees/image1.jpg"]];
[request setDownloadDestinationPath:[[NSHomeDirectory() stringByAppendingPathComponent:#"Documents"] stringByAppendingPathComponent:#"1.png"]];
[request setDownloadProgressDelegate:imageProgressIndicator1];
[request setUserInfo:[NSDictionary dictionaryWithObject:#"request1" forKey:#"name"]];
[networkQueue addOperation:request];
request = [[[ASIHTTPRequest alloc] initWithURL:[NSURL URLWithString:#"sdvdsvsadvsadv"]] autorelease];
[request setDownloadDestinationPath:[[NSHomeDirectory() stringByAppendingPathComponent:#"Documents"] stringByAppendingPathComponent:#"2.png"]];
[request setDownloadProgressDelegate:imageProgressIndicator2];
[request setUserInfo:[NSDictionary dictionaryWithObject:#"request2" forKey:#"name"]];
[networkQueue addOperation:request];
- (void)imageFetchComplete:(ASIHTTPRequest *)request
{
UIImage *img = [UIImage imageWithContentsOfFile:[request downloadDestinationPath]];
if (img) {
if ([imageView1 image]) {
if ([imageView2 image]) {
[imageView3 setImage:img];
} else {
[imageView2 setImage:img];
}
} else {
[imageView1 setImage:img];
}
}
}
- (void)imageFetchFailed:(ASIHTTPRequest *)request
{
if (!failed) {
if ([[request error] domain] != NetworkRequestErrorDomain || [[request error] code] != ASIRequestCancelledErrorType) {
UIAlertView *alertView = [[[UIAlertView alloc] initWithTitle:#"Download failed" message:#"Failed to download images" delegate:nil cancelButtonTitle:#"OK" otherButtonTitles:nil] autorelease];
[alertView show];
}
failed = YES;
}
}
The problem is that suppose fetching second image failed, it displays the error message and stops the whole operation, although image 1 is a valid image file.
Any help will be greatly appreciated.
:)
From the ASIHTTPRequest documentation:
When a request in an ASINetworkQueue fails, the queue will by default
cancel all other requests. You can disable this behaviour with [queue
setShouldCancelAllRequestsOnFailure:NO].
Somebody please... #$%^ please take a look at this. days walking through the debugger, using setData with a jpeg representation. set file using ios4 asset library, trying a new PHP script, deleting the asiHTTPrequest files and making damn sure I have the new ones. Still nothing... Half the code has been put together from examples here or elsewhere on the web.
The goal here, is to simply pick a photo from the camera roll, and upload it, seems pretty easy, I had a different PHP script that was working fine from the desktop and nabbed one from here because it's much more concise and it works from the desktop as well.
so the override for finishing image picking
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
NSString *mediaType = [info objectForKey:UIImagePickerControllerMediaType];
UIImage *originalImage, *editedImage, *imageToSave;
// dealing with a still image
if(CFStringCompare((CFStringRef) mediaType, kUTTypeImage, 0) == kCFCompareEqualTo){
editedImage = (UIImage *) [info objectForKey:UIImagePickerControllerEditedImage];
originalImage = (UIImage*) [info objectForKey:UIImagePickerControllerOriginalImage];
/*
if(editedImage){
imageToSave = editedImage;
} else {
imageToSave = originalImage;
}
*/
chosenImage.image = [info objectForKey:UIImagePickerControllerOriginalImage];
[[picker parentViewController] dismissModalViewControllerAnimated:YES];
//_imageData = [[NSData alloc] initWithData:UIImageJPEGRepresentation(originalImage, 0.0)];
//_imageData = [[NSData alloc] initWithData:UIImageJPEGRepresentation(chosenImage.image, 0.0)];
UIImage *im = [info objectForKey:#"UIImagePickerControllerOriginalImage"] ;
UIGraphicsBeginImageContext(CGSizeMake(320,480));
[im drawInRect:CGRectMake(0, 0,320,480)];
_resizedImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
_imageData = [[NSData alloc] initWithData:UIImageJPEGRepresentation(_resizedImage, 0.0)];
}
[picker release];
}
then the upload method.
-(void)uploadPhoto
{
//NSLog(#"image path inside uploadPhoto --> %#", _imagePath);
NSLog(#"uploadPhoto");
//NSLog(#"%#", imageData);
//_imageData = _imageData;
NSString *unescapedURL = #"http://dev.xxxx.com/upload.php";
NSString * escapedURL =
(NSString *)CFURLCreateStringByAddingPercentEscapes(
NULL,
(CFStringRef)unescapedURL,
NULL,
(CFStringRef)#"!*'();:#&=+$,/?%#[]",
kCFStringEncodingUTF8 );
NSURL *url = [NSURL URLWithString:unescapedURL];
//NSURL *url = [NSURL URLWithString:unescapedURL];
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
[request setDelegate:self];
[request setRequestMethod:#"POST"];
//[request setStringEncoding:NSUTF8StringEncoding];
//[request addPostValue:#"submit" forKey:#"Submit"];
//[request setPostValue:#"Submit" forKey:#"Submit"];
[request setData:_imageData withFileName:#"image4.jpg" andContentType:#"image/jpeg" forKey:#"photo"];
//[request setFile:_imagePath forKey:#"photo"];
//[request setFile:_imagePath withFileName:#"image5.png" andContentType:#"image/png" forKey:#"photo"];
[request setDidFailSelector:#selector(requestFailed:)];
[request setDidFinishSelector:#selector(requestFinished:)];
[request setTimeOutSeconds:500];
[request startAsynchronous];
NSError *error = nil;
NSString *theString = [NSString stringWithContentsOfURL:url encoding:NSASCIIStringEncoding error:&error];
if( theString )
{
NSLog(#"Text=%#", theString);
}
else
{
NSLog(#"Error = %#", error);
NSString *localized = [error localizedDescription];
NSString *localizedFail = [error localizedFailureReason] ? [error localizedFailureReason] : NSLocalizedString(#"not it", nil);
NSLog(#"localized error--> %#", localized);
NSLog(#"localizedFail--> %#", localizedFail);
}
[escapedURL release];
}
then the finish/fail selectors
-(void)requestFinished:(ASIFormDataRequest *)request
{
NSLog(#"requestFinished");
NSString *respondingString = [request responseString];
NSLog(#"response string--> %#", respondingString);
NSData *responseData = [request responseData];
NSLog(#"%#", responseData);
}
-(void)requestFailed:(ASIFormDataRequest *)request
{
NSLog(#"requestFailed");
//NSError *error = [request error];
//NSLog(#"%#", [error description]);
}
Help! Drowning...
It was a problem with the PHP.
move_uploaded_file($_FILES["file"]["tmp_name"]
was the issue.
if you look at this
[request setData:_imageData withFileName:#"image4.jpg" andContentType:#"image/jpeg" forKey:#"photo"];
It's changing the POST so the standard...
move_uploaded_file($_FILES["file"]["tmp_name"]
needs to be
move_uploaded_file($_FILES["photo"]["tmp_name"]
adding
error_reporting(E_ALL);
ini_set("display_errors", 1);
print_r($_FILES);
to the PHP allowed me to see..
response string--> Array
(
[photo] => Array
(
[name] => image4.jpg
[type] => image/jpeg
[tmp_name] => /tmp/phpCSXJgl
[error] => 0
[size] => 150854
)
)
in the selector defined by...
[request setDidFinishSelector:#selector(requestFinished:)];
What I'll do from here is revert the PHP to where it was before
move_uploaded_file($_FILES["file"]["tmp_name"]
and change the setFile call to
[request setData:_imageData withFileName:#"image4.jpg" andContentType:#"image/jpeg" forKey:#"file"];
all will be well with the world and I'm going to get some food. cheers!