asihttprequest

Asihttprequest upload file

风格不统一 提交于 2019-12-04 19:34:56
imusing Asihttprequest to upload file to a server, i have 2 questions : the progressView is not moving smoothly, in fact it move to the and when upload is finish. when i try to upload a big image (> 2 mo approximately ) the upload fail . hers is my code : ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:[NSURL URLWithString:@"http:xxxxx" ]]; [request setDownloadProgressDelegate:progresse]; [request setPostValue:@"upload" forKey:@"action"]; [request addData:[NSData dataWithData:UIImageJPEGRepresentation([UIImage imageNamed:@"xxxxx.jpg"],0.9)] withFileName:@"img.jpg"

PHP - Saving Uploaded Image to Server

两盒软妹~` 提交于 2019-12-04 18:33:39
I am trying to save an uploaded image from an iPhone to a server using PHP. I am using ASIHTTPRequest to handle the data request. This is my iPhone code: [request setPostValue:someString forKey:@"string1"]; [request setPostValue:anotherString forKey:@"string2"]; [request addData:[NSData dataWithData:UIImageJPEGRepresentation(anImage, 0.9)] withFileName:@"img.jpg" andContentType:@"image/jpeg" forKey:@"img"]; [request startSynchronous]; On the server side, I am using this PHP code currently to try saving the image to a folder on my server: print_r($_FILES); $folder = 'upload/'; $image_path =

'kCFStreamSSLAllowsExpiredCertificates' and 'kCFStreamSSLAllowsAnyRoot' is deprecated

六月ゝ 毕业季﹏ 提交于 2019-12-04 17:42:06
问题 I have added the "ASIHTTPRequest" library to my app. Now, I'm trying to remove all warnings in my project. I have fixed all other warnings except those for "ASIHTTPRequest". I'm getting the warnings below. 'kCFStreamSSLAllowsExpiredCertificates' is deprecated: 'kCFStreamSSLAllowsAnyRoot' is deprecated: How to resolve this? Code: NSDictionary *sslProperties = [[NSDictionary alloc] initWithObjectsAndKeys: [NSNumber numberWithBool:YES], kCFStreamSSLAllowsExpiredCertificates, [NSNumber

iphone download image with variable using ASIHTTPRequest

泪湿孤枕 提交于 2019-12-04 16:04:43
I got stuck something annoying. I uploaded images to server it's ok. However, when i try to download image from server i want to get image with string variable. here is my php code server side .... echo "image_getting;"; $fullPath = $_POST['download_image']; echo file_get_contents($fullPath); .... if i remove first line from my server [request responseData] working correctly. However, i want to also get "image_getting;" because i am also downloading some different types. if i can clear, iphone side when i say - (void)requestFinished:(ASIHTTPRequest *)request { NSString *responseString =

How to track the progress of a download using ASIHTTPRequest (ASYNC)

房东的猫 提交于 2019-12-04 14:49:24
问题 I am currently using an asynchronous call to my API (I setup) on my site. I am using ASIHTTPRequest's setDownloadProgressDelegate with a UIProgressView. However I don't know how I can call a selector (updateProgress) which will set a CGFloat 'progress' to the progressView's progress. I tried the following, but both the progresses were zero. Please can you tell me how I can get this working? (in some method) ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:[url

ASIHTTPRequest for dummies

时光怂恿深爱的人放手 提交于 2019-12-04 12:37:46
问题 I'm a COMPLETE DUMMY in ASIHTTPRequest. I have just downloaded the library and added it to my project and now i'm trying to understand basics of working with it. I've found some pretty good example here this little tutorial is about uploading images to a server. I tried it and things seem to work (but i'm confused with NSString returned by [request responseString], it returned HTML code of a whole web page ) but i would like to know how to download images (or anything uploaded) back from the

ASIHTTPRequest Reachability How to

a 夏天 提交于 2019-12-04 10:58:55
As much as I like ASIHTTPRequest, it isn't documented anywhere how to use the modified the Reachability class, and I couldnt find it on stackoverflow, or any sample projects either. Currently im at this point: Reachability *reach = [Reachability reachabilityWithHostName:@"http://google.com"]; [reach startNotifier]; if ([reach isReachable]) { NSLog(@"connection"); }else{ NSLog(@"no connection"); } Which doesn't seem to work. You need to set up a notification handler for this: Reachability *reach = [Reachability reachabilityWithHostName:@"http://google.com"]; [[NSNotificationCenter defaultCenter

How to Pause and Resume Downloading Files with ASIHTTP Request in iPhone

北城以北 提交于 2019-12-04 09:49:29
问题 I m using ASIHTTP Request sample source code for downloading urls. My question is that how to pause and resume the downloading files. Please Help. 回答1: Deprecation Notice ASIHTTP was deprecated around 2011, if you want network connectivity now, you should look up AFNetworking for ObjC or Alamofire for Swift, or stick to the native support: For native support, in iOS 7 Apple added the NSURLSession , which can start download tasks ( NSURLSessionDownloadTask ), and these can be cancelled and

Incorrect NSStringEncoding value 0x0000 detected

橙三吉。 提交于 2019-12-04 08:32:59
I am using ASIHttpRequest library in iphone and when i try to do a GET request on the below URL i get this message and the request fails, please anyone if he/she has encountered this problem or know a possible solution to it please let me know. Secondly if i paste the link in the browser it works perfectly fine. [URL] http://www.rugsale.com/iphone/app/?type=product_list&params=id%3D334&ver=1.0&key=kaoud [ERROR] Incorrect NSStringEncoding value 0x0000 detected. Assuming NSStringEncodingASCII. Will stop this compatiblity mapping behavior in the near future. Thx in advance Regards Syed Arsalan

Cannot Get ASIHTTPRequest callback delegate to trigger

我只是一个虾纸丫 提交于 2019-12-04 05:51:00
问题 Why does my callback delegate not trigger: #import "dbConnector.h" #import "ASIFormDataRequest.h" #import "JSONKit.h"; @implementation dbConnector //method to +(void)getQuestions:(NSString*)sectionId{ NSString* url = @"http://dev.speechlink.co.uk/David/tester.php"; NSURL *link = [NSURL URLWithString:url]; ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:link]; [request setPostValue:sectionId forKey:@"section"]; [request setDelegate:self]; [request setDidFinishSelector: