I want to create a simple script help me for calculate the time is take when I upload a image to the server I have some thing like this
$(document).ready(function(){
$("#but_upload").click(function(){
var fd = new FormData();
var files = $('#file')[0].files[0];
fd.append('file',files);
$.ajax({
url: 'http://uploadtomyapi.com',
type: 'post',
data: fd,
contentType: false,
processData: false,
success: function(response){
// done my calculation here
});
});
});
I don't know this is the better way for do it but I am new in this, can some one help me thanks so mush.