Download iOS UIWebview from the application directory using an HTML form

I am wondering if there is a way to download the file from the application home directly using UIWebview, which has an HTML form with file input.

I download this from UIWebview:

<form action="test.php" method="post" enctype="multipart/form-data">
    <label for="file">Filename:</label>
    <input type="file" name="file" id="file"><br>
    <input type="submit" name="submit" value="Submit">
</form>

but the iPhone asks if I want to "take a picture" or "choose an existing one." I would prefer to select a document or image located in the local directory of the application.

Is it possible?

Thank!

+4
source share
3 answers

I am also looking for an answer. After my own digging, it seems like the only way:

  • intercept when the user presses the download button
  • add custom file picker
  • , NSURLConnection, .
+1

iOS " ", UIWebView .:

-

UIImagePickerController, .

POST

NSData​​p >

POST NSURLConnection, NSData

0

, , UIWebView IOS html:

, Apple html, , . ( , Safari IOS.)

, UIWebView, / . , UIWebView IOS , , POST .

. InterfaceBuilder , UIImagePickerController. HTTP POST . , , , : ios HTTP POST

0
source

Source: https://habr.com/ru/post/1531380/


All Articles