Ionic webapp: input field file upload - ionic-framework

I am currently building a web app with ionic
in the input field, I need to upload a photo either from the camera or select from the gallery. the code I am using is
<ion-item>
<input type="file" accept="image/*;capture=camera" name="imagefile"
(change)="changeListener($event)">
</ion-item>
however, on the PC, it shows the file browser, but on the mobile phone (android & ios), it just uses the camera. there is no option to select images from the image gallery.
I tried removing the capture=camera part, but still, it only calls out the camera on mobile devices. Is there any way to be able to select files from the device gallery?

Have you figured this out? If not, I've found a great example for you to follow.
ionic-pwa-camera-no-plugins
Hope this is helpful and please update your findings here.
Cheers.

Related

How to upload a pdf from iphone using phonegap?

I was able to upload images present in my imagegallery using the phonegap application.
I want to know whether it will be possible for me to upload a pdf from the iphone application. Either using phonegap OR any native technologies.
Have you tried to add a <input type="file"> field and send the form against a script where you can work with it?
Perhaps this will lend you in the right way.

HTML File Chooser on iOS

Can we access the iOS camera roll using the Safari's file chooser i.e. <input type="file">? According to this question, we cannot access the camera.
No, you can't. Safari doesn't support file uploading. You can, however, purchase and install iCab, which does.

How to access the iPhone's camera from Mobile Safari

Is there a API or way for accessing the the iPhone's camera from Mobile Safari?I want to create a application that can read barcode within the browser.
Thanks in advance.
It's now supported in iOS 6. I believe it uses a regular form file input field.
You can see some explanation here.
Try using input tag <input type="file" name="image" accept="image/*" capture/>.
It works well as compared to getUserMedia method which is fully supported by Opera mobile and chrome higher versions.
Hope it help.
No. There's no way to do that. No web page can access internal devices.
You can do however a small tiny app that its launched via mobile safari link and makes user select the barcode image and then redirect to a web page that will process (the small app will also upload). Like what THIS guys actually implemented (the link provides code).
If you doesn't have experience with Objective C and Cocoa Touch you can create that app via PhoneGap like if you were creating a Web Page.
UPDATE
From iOS 6 and so on you actually can as the official specs says, you can use it via the upload API as seen here.

iPhone File Upload with HTML

Is there any way to use <input type="file"> in Safari on iPhone/iPod Touch? Or is there something similar that I can use inside the browser? I want to upload a photo from the device to my database using the browser.
This is possible with iOs 6 or greater (http://www.apple.com/ios/whats-new/#safari). The browser renders
<input type="file">
and clicking on "Choose File" prompts the user to take a new photo or choose existing from the photo library.
Can't be done with plain XHTML/javascript as Safari does not support uploads. See this previous question for a potential workaround solution to upload photos.
I had the same problem today. The alternative browser iCab Mobile does support file uploads. I got it for my iPad and (at least for me) file upload works fine.

Download pdf throgh web view how to do?

In my app i have shown pdf from the remote server using webview and i have to add a action to download the pdf and save it into iPhone how to do...Using Php i tried to force download pdf,which works in browser(desktop) not in device
Can any one help me...
The (unjailbroken) iPhone's Safari cannot access the local file system, so it's impossible to download anything.
(The iPad, OTOH, may support it.)
use the download attribute in slide your a tag
<a href="content/file.pdf" download > pdf link </a>
<a href="content/file.doc" download > doc link </a>