upload files via iPad

2019-01-14 22:34发布

问题:

One of our users just notified us that our web application works very well through Safari on the iPad (or whatever the default browser is -- I assume Safari). The only thing that doesn't work is the file upload part.

Our web application enables our users to attach files in various parts of the system.

I was thinking about this. The iPhone takes pictures, but doesn't really give me the ability to upload them via a standard web interface (where you click a button, choose a file, upload the file, etc).

Is this even possible? Or is the only way to upload files from an iPhone/iPad via a custom app written for the device?

Is there a way to upload a file on an iPad via the web browser?

回答1:

As far as I know the iOS doesn't expose a file system to the user, so it wouldn't really make sense for it to be possible to upload files via a web interface. Most of the apps that do exist, sync files through iTunes or something similar.

One approach I've also seen used was for the iOS device to act as a fileserver and enabling you to download files that way. This is how iFile works.

In short, to my knowledge it isn't possible.



回答2:

This ability was shown during the 2012 WWDC keynote. I believe details are under NDA unless you're a registered iOS developer. Take a look at the iOS 6 beta documentation.

This post has a photo of the keynote slide highlighting "photo upload" as a new feature. http://www.anandtech.com/show/5987/ios-6-safari



回答3:

Mobile safari on iPhone/iPad does not allow file uploads (the file upload button/widget is displayed disabled), however you can re-enable that feature by calling a third-party uploader app from your web app/site.

Have a look at http://www.aurigma.com/iphone/ for such an uploader app.



回答4:

There are some replacement web browsers you can get from the app store that allow you to upload. You use them instead of Safari. One example is iCab Mobile.



回答5:

There is now way via HTML5 on iOS6+ devices.

<input type="file" capture="camera" accept="image/*" id="cameraInput" name="cameraInput">

I found the answer here: https://stackoverflow.com/a/16775971/1783439

I've tested it in Safari on an ipad with iOS9.



标签: ipad safari