title: jQuery file upload and save without server side
body: <p>can you please acknowledge me if there is a way to create a simple file uploader with jQuery and save that file (image) in some folder ... without the use of any server side scripting such as php etc.
  Here is some simple script i tried so far</p>
  
  <pre><code> $(document).on("click", "#upload", function() {
      var file_data = $("#avatar").prop("files")[0]; 
      var form_data = new FormData(); 
      form_data.append("file", file_data);
      $.ajax({
                  url: "/img",
                  dataType: 'script',
                  cache: false,
                  contentType: false,
                  processData: false,
                  data: form_data,
                  type: 'post'
         });
  });
  </code></pre>
  
  <p>HTML</p>
  
  <pre><code>&lt;form enctype="multipart/form-data" method="post"&gt;
      &lt;input id="avatar" type="file" name="avatar" /&gt;
      &lt;button id="upload" value="Upload"&gt;UPLOAD&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>