Help with code for mobile

Discussion in 'HTML & Website Design' started by chrisj, Sep 28, 2017.

  1. #1
    When this code (below) on the web page is viewed by mobile device, and 'Choose File' is selected the mobile device video camera feature appears.

    <html>
    <head><title>Upload</title></head>
    <body>
    <form action="upload1.php method="post" enctype="multipart/form-data">
        Select image to upload:
    <input type="file" accept="video/*" name="fileToUpload" id="fileToUpload">
        <input type="submit" value="Upload Image" name="submit">
    </form>
    </body>
    </html>
    Code (markup):
    I have figured out that this code will pop up this image on an iphone (attached):

    <input type="file" accept="video/*" name="fileToUpload" id="fileToUpload">
    Code (markup):
    but I'd like help to get it so that when "Take Video" is selected, the camera is facing the user.

    I know the code is capture="user", but I've tried to figure out where that fits in, to accomplish that, and have been unsuccessful.

    Any help will be appreciated.
     

    Attached Files:

    chrisj, Sep 28, 2017 IP
  2. SoftLink

    SoftLink Active Member

    Messages:
    140
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    60
    #2
    Well, to start with you've got a typo in the code: <form action="upload1.php method="post"
    You need a " at the end of php:
    <form action="upload1.php" method="post"

    You should just be able to add the attribute into the tag like this:
    <input type="file" accept="video/*" capture="user" name="fileToUpload" id="fileToUpload">
     
    SoftLink, Oct 4, 2017 IP