简体   繁体   English

从iPhone浏览PDF文件并在服务器上上传

[英]Browse PDF file from iPhone and Upload on server

In my application I need to allow the user to browse some PDF files from iPhone and upload one to a server. 在我的应用程序中,我需要允许用户从iPhone浏览一些PDF文件并将其上传到服务器。
I know how to upload a PDF file on a server, but I don't know how can I browse for PDF files. 我知道如何在服务器上上传PDF文件,但是我不知道如何浏览PDF文件。

Please help me. 请帮我。

You can only view files in that your App's sandbox. 您只能在该应用的沙箱中查看文件。 Every App has got a Documents, Cache and temp folders. 每个应用程序都有一个文档,缓存和临时文件夹。

sample code : 示例代码:

NSError *err        = nil;
NSArray *myPathList = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
NSString *myPath    = [myPathList  objectAtIndex:0];
NSArray *dirContent = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:myPath error:&err];
if(err) NSLog(@"ERROR: %@",[err localizedDescription]);
NSMutableArray *filePaths  = nil;

int count = (int)[dirContent count];
for(int i=0; i<count; i++)
{
    [filePaths addObject:[dirContent objectAtIndex:i]];
}
return filePaths;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从iPhone浏览PDF文件 - Browse PDF file from iPhone 是否有可能从iPhone访问pdf文件并上传到服务器ios - is it possible to access pdf file from iphone and upload to the server ios 就像我能够通过ibook来浏览pdf文件一样,如何从我的iPhone来浏览我的app的pdf文件? - How to browse pdf file from my iphone for my app, just like I am able to browse pdf file through ibooks? 如何将图像、pdf、音频、视频和任何文件系统从 iphone 本地内存上传到服务器(API) - how to upload image,pdf,audio,video and any file system from iphone local memory to server(API) 在iPhone中通过Web服务上传pdf文件(从文档目录)? - Upload pdf file (from document directory) through web service in iPhone? 使用AFNetworking从iPhone向Web服务器发送pdf文件? - sending a pdf file from iphone to web server using AFNetworking? 如何将图像文件从文档目录上传到iPhone中的php服务器 - how to upload image file from document directory to php server in iphone 如何从应用程序主捆绑包将pdf和docx文件上传到服务器? - How to upload pdf and docx file to server from app main bundle? 如何使用phonegap从iPhone上传pdf? - How to upload a pdf from iphone using phonegap? 如何使用cordova从iphone上传pdf? - How to upload a pdf from iphone using cordova?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM