Where are the PDF files in iPhone ? Can I load them in an app? - objective-c

I want to make the user of the app I'm developing, able to load a PDF file from his device as if he was loading an image from the gallery.
Is it possible and if so, where are the PDF files ?
Thanks a lot for your advices

I think that isn't possible, see that: https://stackoverflow.com/a/7778719/1451392

No, it's not possible. Every application has its own memory space (.app folder) which it can access (plus some special folders like the image gallery).
You can access your share of memory via [NSUserDefaults sharedDefaults].

Related

MacOS/Safari double extensions when using ImageResizer

We are converting large PNG images to JPEG using ImageResizer (https://imageresizing.net/). It's works great with ?format=jpg and they are delivered with the correct content type and all.
When downloading these images they are named image.jpg in all browsers except Safari. Here it asks the user if they want to go with .jpg or with .png. It also saves the images as image.png.jpg which is confusing for some users.
I read something about Content-Disposition header, but I think that's for direct download, not for right click and choosing Save as. I also don't know if it would be possible to add it without creating some kind of middle layer and probably lose performance.
Ideas? Thanks <3
I don't think there is a solution to this, as it is in the browser's control.

iOS app files that the user can download from the app

The idea is that i will create a file in the app and store some data in it.
I want for the end user to be able to download that file from the iOS device to his mac/pc.
Is this somehow possible? Where should i put the file for the user to be able to download it via itunes?
Here is good tutorial you can use:
Tutorial
It is important to know, that in iOS, when your user needs to create file, you do not need to care where to save it.
Another possibility for you might be to avoid saving data as file. For example, if your data is picture:
UIImage send to email

Download images from an external source iOS

Is it possible to download images from a web server and save them in such a way that
[UIImage imageNamed:#"filename"]
would still work for filename.png and filename#2x.png just as if they had been sent along in the application package all along?
Adding my comment as an answer. You can try to send the scale based on retina/non-retina and then download a single image based on that. You dont need to worry about combining two images and downloading since a device can be either retina or non-retina only. You dont need both images at the same time.
You can download the images based on retina/non-retina of the device itself. No need to keep both in the same device.
As you are considering downloading both images, so bandwidth per se is not of concern, why not combine the two images into a multi-resolution TIFF and download that from the web server? If you do that and load the image from the file the correct resolution will be picked automatically.

How to load an image with unique names from a private folder?

I am working on an app for iPad where I want to have lets say 100 jpg's in a folder.
They could be named like 01.jpg, 02.jpg etc.
In my app I like to browse those images and when clicking on one of them I need the name of the image to be able to send some data over the network (the data part works fine).
I tried to use UIImagePicker but I found out there are no name connected to the actual image.
Then I made another approach where I have a number of pages where I have buttons and here I load in the images which works fine as long the are a part of the recourse of the project...
But here comes the real problem.
The user of the app should be able to change those images over time without recompiling the app.
So I do look for a way to have a folder where the user can place/replace images with the names 01.jpg etc and the app to use those updated images.
Ideas are very welcome.
Wiljan
I am not sure that I understand what you mean, but You can save images in your application documents folder. You can find more details at:
http://developer.apple.com/library/ios/#documentation/iphone/conceptual/iphoneosprogrammingguide/StandardBehaviors/StandardBehaviors.html#//apple_ref/doc/uid/TP40007072-CH4-SW6
You can also use NSFileManager to copy files.
what I suggest to do is :
put default images on project resources.
At first start, copy files to documents folder.
always use images from documents folder.

How to save webcontent and images in objective-c iPhone app?

Requirement of my project is, if device have internet connectivity, need to get the content from server and show it in UIWebview, other wise get conent from local. For that i have stored xml content to sqlite, i don't know how should i save the images which comes in HTML NODE to local. can any one help me out.
Thanks
sri
You are getting url of the image. You can create the documentdirectory and save the images in that directory. http://developer.apple.com/library/ios/navigation/index.html?section=Resource+Types&topic=Sample+C#section=Resource%20Types&topic=Sample%20Code from this url you can find Apple sample code regarding url connection