How to upload photos to my server with an iOS hybrid web/binary Application? - iphone

I'm working on a hybrid app for iOS,
This application is a binary which basically contains a UIWebView to use my client's web service. The binary does also provide feedback to the user about the connectivity status of the device (using reachability).
There's a feature that I'm working on now, which basically requires a user to fill a small web form in the UIWebView, and that should allow the user to "attach" a picture (e.g avatar).
I was wondering if I could exploit the fact that I'm wrapping the UIWebView (to interact with the web service) in a binary to handle the image upload for the user without having to leave my Application?
I'm open to possible solutions.
Cheers.

Have a look at UIImagePickerController. It allows the user to pick images from the Photos app or the Camera within your application. Then you can upload the selected image to your server using NSURLConnection. The presence of UIWebView is irrelevant.

Related

Showing dynamic web-content from iOS local server (i.e. using browser as remote screen)

I want to show some really simple graphics in a http-page in the local network using an iOS App as local server.
Now I heard showing some http-page over the local network is quite easy, using for example CocoaHTTPServer.
Would it also be possible to adjust the content of the page dynamically, from the iPhone side?
Meaning
user types in URL at the desktop-pc-browser of his choice
user goes to his sofa, flicking through text/images with his iPhone, looking at the remote screen
(no need to go to the browser to refresh page?)
Would this be feasible?
Of course I could also try to set up some Bluetooth-Connection, connecting between iOS/MacOS Apps, but I figured the browser version would be much more flexible :)
Stable connection? No need to support each and every browser? Then open up a websocket connection between your app and your browser. You’d then advise your browser to reload or show another picture through the websocket.
If you need to support more browsers, you might need comet / long-polling support. I’m not sure, though, whether CocoaHTTPServer supports it.
If none of these work, you could have your webapp do an Ajax request every now and then, in order to check whether something has changed.

Upload photo to FTP via mail from iPhone

I'm building a web-application where users can upload their images. What I know is that it's "impossible" to do a file upload from an iPhone. Is it possible to achieve the same thing by letting the users e-mail their images to an adress on the same domain and the upload from there?
It's not impossible, but you will need to write some code to do so and get it deployed on the app store. If you google for something like iphone http fille upload you'll come across loads of code examples.
It's quite possible there is already an app to upload to arbitrary web hosts, I've never looked.
Why not go with an MMS online supplier with an api? and then get the image from the api.
http://www.routomessaging.com/sms/sweden.php
If not then you could probably do what you want with an open mail client and some rules, or you could build a simple mailserver from one of the libraries on the web, should not be too hard...

Is it possible for a mobile webpage to capture a picture?

Assuming you built a page for each specific mobile browser (Android/iOS/BB/etc.), is it possible to have a web application capture an image and send it to the server for processing?
I'd like there to be "Nothing to install" for my application, but if I need to reach out to the hardware at all, I fear it's not possible.
There is the Video Capture API but I have no idea how widely spread addoption is at present and it is very new.
IF this api isn't avalible there isn't really much you can do other then asking users to upload it using a standard file upload and them to take the picture before hand.
This is one area that a native application would be far far better as intergeneration would be easier and more seamless for the user.

A caching solution for iPhone application

What I'm building is simply an application that fetches data over the web and displays them on the iOS views. Data are text and, sometimes, images / music files / movies.
I'd like to use some caching solution for the media. What it needs to do is:
get an url of the file
check if it's alredy downloaded in the cache storage, if it is, serve it
if not, download it
while also checking how much of the storage the current cache uses, and, if it's over the quota, delete oldest files
Best would be to have a simple interface for this - so I can just give an url and get the file of it (while files can change over time and reside on the same URL, so this should be handled too, in a perfect case).
Anyone knows a library to do it, on iPhone/iPad application?
ASIHttpRequest has a DownloadCache option that may work for you. From their documentation:
* You want to have access to the data when there is no internet connection and you can't download it again
* You want to download something only if it has changed since you last downloaded it
* The content you are working with will never change, so you only want to download it once
This is what I used in my iPad app and it works pretty well.
You could try looking at using a UIWebview for the view. If I am understanding this correctly, you will be hosting your content on a web server and would simply like the iOS device to pull the content from the URL. This is what UIWebview is. It is essentially programmable access to Safari.

iPhone App with Web Service Access

I have been asked to write a compliment website/service for an iPhone app.
The app creates images. The author wants these images to be uploaded onto the server, into their personal storage area. These images need to be able to be pulled down to the iPhone later for editing. The user will be able to use the website as well to see these images.
I have yet to decide (or understand) what the best way of implementing this would be. And with no experience with iPhone development I have no idea what it can actually handle.
Uploading and downloading images is trivial using NSURL and associated classes. You just open the URL, write/read the file and you're done.
See The URL Loading System to get started.