Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If your target phone's browser supports <a href="http://www.w3.org/TR/html-media-capture/" rel="noreferrer">file upload input type</a> and <a href="http://www.w3.org/TR/FileAPI/" rel="noreferrer">FileAPI</a> (e.g. iOS 6.0 Safari) </p> <pre><code>&lt;input type="file" name="image" accept="image/*" capture&gt; </code></pre> <p>then you can let your user pick an existing file, or even use camera to take a shot, and read some attributes of an image file (file name, size, type, modification date). </p> <pre class="lang-js prettyprint-override"><code>$("input[type=file]").change(function(){ var file = $("input[type=file]")[0].files[0]; alert(file.name + "\n" + file.type + "\n" + file.size + "\n" + file.lastModifiedDate); }); </code></pre> <p>You can also make a preview of a chosen file using <code>FileReader</code>.</p> <pre class="lang-html prettyprint-override"><code>&lt;div id="preview"&gt;&lt;/div&gt; </code></pre> <pre class="lang-js prettyprint-override"><code>displayAsImage3(file, "preview"); function displayAsImage3(file, containerid) { if (typeof FileReader !== "undefined") { var container = document.getElementById(containerid), img = document.createElement("img"), reader; container.appendChild(img); reader = new FileReader(); reader.onload = (function (theImg) { return function (evt) { theImg.src = evt.target.result; }; }(img)); reader.readAsDataURL(file); } } </code></pre> <p><strong>Here is working <a href="http://jsfiddle.net/pmatseykanets/R99NY/" rel="noreferrer">jsFiddle</a></strong></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload