How to handle input type=file event from ios?

Viewed 322

Currently I'm developing a website (that mainly runs in iOS WKWebView) and a native iOS app.

Normally, if I want to select some image or video to upload in webpage inside webview, this is what happens:

  1. Click html input tag (ex. <input type="file" ... /> )
  2. Choose 'Photo Library' option
  3. Choose images or videos and click add
  4. Files are loaded in webview

Question: Is there any way to do some stuff in between 3 and 4? For example, can I select a video file, modify it, and then pass the modified file to browser?

In Android WebChromeClient, it handles html input tag with onShowFileChooser which has callback to return the list of selected files to the browser. In this scenario, the app can do whatever stuff before passing the result to the callback.

Does iOS webkit have some equivalent method like this? Or, is there a way to manually select files from native app and pass it to the html input tag inside webview?

0 Answers
Related