Advertisement
Guest User

Untitled

a guest
May 31st, 2016
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. <div id='file_browse_wrapper'>
  2. <input class="iconos" type="file" name="File Upload" id='file_browse' accept=".csv" />
  3. </div>
  4. <label id="url-archivo"><b>Selecciona tu archivo...</b></label>
  5. <button class="btn btn-success" id="carga-archivo">Subir</button>
  6.  
  7. $("#carga-archivo").click(function () {
  8. var fileUpload = document.getElementById("file_browse");
  9. if (fileUpload .value != null) {
  10. var uploadFile = new FormData();
  11. var files = $("#file_browse").get(0).files;
  12. // Add the uploaded file content to the form data collection
  13. if (files.length > 0) {
  14. uploadFile.append('file-'+i, file);
  15. $.ajax({
  16. url: "/2/delivery/client/massive",
  17. contentType: false,
  18. processData: false,
  19. data: uploadFile,
  20. type: 'POST',
  21. success: function () {
  22. alert("file upload successfuly");
  23. }
  24. });
  25. }
  26. }
  27. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement