Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It sounds like they are using a web form, so you should strictly use POST. There is no getting round using a script somewhere if you want the client to send you a string (but why would you have them do this?). </p> <p>If they are POST'ing a form, use the POST method, then have a server side script use PUT to write to a backend API server, which will return a JSON page with the link to the latest image.</p> <p>If they are writing directly to the API, follow the same convention, except your user will use PUT directly (PUT isn't available in web forms, just POST and GET).</p> <p>EDIT: I have a possible solution for you for the client-side using HTML5. You could put the image into an html5 canvas and convert the data into a string. Then just grab that string and POST it via the form. See <a href="https://stackoverflow.com/questions/12950465/how-to-get-image-bytes-string-base64-in-html5-jquery-javascript">this answer</a> for more info on how to do this. </p> <pre><code>&lt;label&gt;Image File:&lt;/label&gt;&lt;br/&gt; &lt;input type="file" id="imageLoader" name="imageLoader"/&gt; &lt;canvas id="imageCanvas"&gt;&lt;/canvas&gt; &lt;script&gt; var imageLoader = document.getElementById('imageLoader'); imageLoader.addEventListener('change', handleImage, false); var canvas = document.getElementById('imageCanvas'); var ctx = canvas.getContext('2d'); function handleImage(e){ var reader = new FileReader(); reader.onload = function(event){ var img = new Image(); img.onload = function(){ canvas.width = img.width; canvas.height = img.height; ctx.drawImage(img,0,0); } img.src = event.target.result; } reader.readAsDataURL(e.target.files[0]); /** replace readAsDataURL() with something that will read it to a string. Reference: https://developer.mozilla.org/en-US/docs/DOM/FileReader **/ } &lt;/script&gt; </code></pre> <p>To summarize: put the image into the canvas DOM element, then convert the canvas data to a string.</p>
    singulars
    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. 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.
    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