Guest User

Untitled

a guest
Nov 16th, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. jQuery("#upload-button").Upload({
  2. url: "/wp-content/uploads/userphoto",
  3. name: "myfile",
  4. updateInterval: 1000,
  5. onSelect: function() {
  6. // File has been selected, let's see what it is:
  7. console.log(this.file);
  8. this.sendFile();
  9. },
  10. onUpdate: function() {
  11. // Let's update the user interface!
  12. jQuery("#bootstrap-progress-bar").css("width", this.getPercentage() + "%");
  13. jQuery("#throughput").html(this.getThroughput());
  14. jQuery("#upload-speed").html(this.getSpeed());
  15. // Need raw progress info for your own calculations?
  16. console.log(this.progress);
  17. },
  18. onComplete: function(dataFromServer) {
  19. // By default the response from the server is parsed, and we get it here
  20. console.log(dataFromServer);
  21. },
  22. onError: function(xhr) {
  23. alert("Some upload error happened");
  24. },
  25. onCancel: function() {
  26. alert("You the man!");
  27. }
  28. });
Add Comment
Please, Sign In to add comment