Upload large files to SPA (angular + express)

Normal for file upload i do

<form method='post' enctype='multipart/form-data'>      
    <p><input type='text', name='name'/></p>            
    <p><input type='file', name='image'/></p>      
    <p><input type='submit', value='Wyślij'/></p>    
</form> 

What if I want to submit this form without reloading the page?

I can use the "new FileReader ()" and bind base64 to $ scope, but it does not work with large files.

Can I upload my form without reloading the page as described above?

0
source share
2 answers

I think you should look at the ng-file-upload directive already created.

Functions

  • Supports loading, canceling / canceling downloads at runtime, dragging and dropping files (html5), dragging and dropping directories (webkit), CORS, PUT (html5) / POST methods.
  • (HTML5 HTML5) Flash polyfill FileAPI. /
  • db- CouchDB, imgur .. $upload.http(). angular http POST/PUT.
  • , FileAPI , HTML5, /, HTML5.
  • , $http ( HTML5), angular $http.
+1

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


All Articles