I am new to building iphone apps. Have been searching the net on how to create a file dialog. That will allow me to select either images or videos to be uploaded to a website.
If this was a .NET application I would use the FileDialog on my winforms view.
Your help is much appreciated.
Take a look at the UINavigationController, UITableViewController and NSFileManager classes for building a file system browser, which reads the contents of the app's ~/Documents folder and allows "drilling down" into subdirectories.
I suggest using a UITableView for holding files, NSFileManager for learning how to manipulate files stored on the iPhone, and then using HTML POST requests (depending on the site) to push the data to the site. Go find these in the developer documentation!
Related
I want to allow the user to upload the files in my iOS application just like the way we upload a particular file in desktop applications with browsing through the different directories. I did some googling too, but did not find the reliable solution.
Someone says that.
The whole file system is not available, if you're running a non-jailbroken phone. Neither are there filesystem browser controls (for the same reason), However, you can browse the user's photo library, or even take a photo with the camera using UIImagePickerController.
Some questions were like this
Is iOS developer able to view file systeme
How to list all folders and their subdirectories/files in iPhone SDK
From these links and from other sources,
I am only confused that can i provide the file browse option to user on button tap. And if yes, then how it can be achieved? Any help will be appreciated.
If the user taps on the Browse button the list should be there like
iPhone apps are sandboxed. This means that you can only access files/folders inside your AppBundle (like Documents, Cache and the like). That is what the above mentioned URLs are suggesting. You can only upload/download data from/to these folders.
Now if you have a jailbroken phone, its a different scenario. Not going into that.
Check this link out:
Apple iOS Environment under that The App Sandbox
There is no standard control for this purpose, but using the methods mentioned in the posts you referenced, populating a table view is perfectly doable. Keep in mind that this will allow you to view the files in your application's sandbox. You cannot access files of other applications.
Alternatively, you can use open source libraries like the ios_file_browser or the iOS-File-Browser. These provide user interface and you can check out the implementation as well.
Starting in iOS 8, you can use UIDocumentPickerViewController, "a view controller that provides access to documents or destinations outside your app’s sandbox":
https://developer.apple.com/documentation/uikit/uidocumentpickerviewcontroller
I'm an author of FileExplorer control which is a file browser for iOS. It allows you to browse files and directories that are placed inside your sandbox in a user-friendly way.
Here are some of the features of my control:
Possibility to choose files or/and directories if there is a need for that
Possiblity to remove files or/and directories if there is a need for that
Built-in search functionality
View Audio, Video, Image and PDF files.
Possibility to add support for any file type.
You can find my control here.
browse file in iphone I'm developing an iPhone app in which I have to upload the PDF and text files on server from iPhone. Please guide me can i browse all pdf files stored in iPhone into my application?
Its not possible to Monitor(Browse) the Files in IOS. Apple does not Approve this type of applications. And also iPhone/iPad we can't access the Other Application Data's. As per your point The PDF must be located in Other iOS Application. We can't Browse the Files Except Bundles and Documents folder.
Only way you can Upload file to Server and Make browser list Using Tableview.
The following are the possible ways to do this.
FTP UPLOAD:
We can Upload Documents to FTP Server and Download Via FTP in iOS.
In This. Upload and Download we neet to use Authentication policy.
SimpleFTPSample
Upload things to a FTP in Objective-C iOS
Server Upload.
We can Upload File to Server(Php,ASP.net,ect). The download is Ordinary method.
Link 1
Link 2
You app runs in a Sandbox environment. This means the app can only access files and directories within its own contents.
More Information On File System Programming Guide
I wanted to open the files available in my web application to its corresponding native apps in PC. I have created the set of program to download the file from web app but didn't know how to set that files to open with native app in system. kindly help me in this. If you have any other options to use rather than downloading and displaying the file please suggest me.
Note: I am using eclipse to develop web app
This problem is not related to GWT. Just provide links to files in your app. When a user clicks on link, user's browser/PC will decide what to do with a file. It will either open the file within a browser (PDF, images, some video and music files depending on a browser), or it will offer to save them.
In a new app, I plan to let users download their own files and stored them inside iPhone. The process is typically:
iPhone present a web page by UIWebView, in which there are several links to .zip files
the user browser the page and click on one of the .zip file link
iPhone downloads the file into the iPhone document folder, closes WebView, acknowledges the user when download is complete
How can that be done? Thanks
You'll need to handle the click of the link yourself by capturing the request on your UIWebViewDelegate implementation, and then downloading the file with NSURLRequest asynchronously. This question is essentially the same thing at that point. If you want to unzip, have a look at this question.
Is it possible to write a webapp, then embed it in a native app so it can be launched without data and sold through the app store?
The Pre makes it easy to reference files in the local file structure, so it's very easy to build a webapp (HTML, CSS and Javascript) and embed it into a native app.
Is it possible to take the same plain HTML, CSS and Javascript (no Mojo/Webos-specific code) and embed it in the same way into a native iPhone app? This would make it seem to the user as if the icon in the home menu launches a webapp, but the app can be accessed without any data and can be sold through the app store.
Thanks,
~J
Within my application, I have a complete HTML-based manual that I use a UIWebView to display. The HTML, CSS, and images are all stored locally in a Help directory within my application bundle. I simply load the first page using code like the following:
NSString *path = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:#"Help"];
NSURL *helpURL = [NSURL fileURLWithPath:[path stringByAppendingPathComponent:#"helpintroduction.html"]];
NSURLRequest *URLReq = [NSURLRequest requestWithURL:helpURL];
[webHelpView loadRequest:URLReq];
and everything loads and displays as if it were on a remote server.
To preserve the full directory structure of your HTML, etc. files, simply add those files to your Xcode project, dragging in directories where you can, and add a new Copy Files build phase. Make the destination Resources and the path whatever you want to use for the base of your web files (Help in the example above). Finally, drag all of the HTML, etc. resources you added to your project into this Copy Files build phase so that they end up bundled with your application.
I see no reason why this wouldn't work with more complex web applications, and I've seen no action by Apple against people doing this within their own applications.
I don't see why not, just give the UIWebView a baseUrl of your local stored bundle.
Look at PhoneGap (http://phonegap.com/)
I haven't used it but it may be a good solution for what you're trying to do.
Yes, it is perfectly doable. You just need to build the absolute path to your HTML files within your application bundle, using "file:///" as the protocol, and point the URL of a UIWebView to it. You can do a quick and dirty test using the iPhone OS simulator and writing something like "file:///foo/bar.html" on Safari.app, provided that HTML exists, it will load just fine.
The problem is packaging it. From what I can tell (and i could very well be totally wrong), apple just dumps all your files into one resources folder, regardless of directory structure in your project. So if you create a webpage that references images/logo.png and javascript/script.js, suddenly those files will be located in / instead of their respective folders. Given that, it might be feasible to create a web app with a completely flat structure from the start.
There's no technical reason I know of why this should be problem.
However, there's always the chance that Apple could reject the app for doing something like this — they certainly haven't been shy about rejecting apps for not "behaving properly" before, and web apps have some certain peculiarities which make them not feel like native apps.
Such a rejection could probably be resolved by resubmitting, since there's certainly no standard for this kind of thing, but it's certainly something to be aware of.
If you are not a coder and you are interested in iOS only, you can follow these steps:
Download xCode
Download simple web view app from https://github.com/nomtek/iOSWebViewApp
Open simple web view app within xCode
Add your HTMLs to the project file structure
Run your app and voila :)
This approach is good if you don't need access to any phone specific features, just a standard Web View. Loading time will be short as this approach doesn't load any extra libraries.