Skip to content

Instantly share code, notes, and snippets.

@fregmented
Created April 6, 2015 15:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fregmented/1c69f661aedb108635db to your computer and use it in GitHub Desktop.
Save fregmented/1c69f661aedb108635db to your computer and use it in GitHub Desktop.
console.log("Droped!");
var files = e.originalEvent.dataTransfer.files;
console.log(files)
//We need to send dropped files to Server
//handleFileUpload(files,obj);
var urls = [];
for(var i = 0; i<files.length; i++){
var fd = new FormData();
fd.append('musics', files[i]);
$.ajax({
type : 'POST',
url : '/artist/getUploadPath',
data : "user="+getUser(),
cache : false,
async : false,
success : function(data) {
urls.push($.parseJSON(data));
}
});
var status = new createStatusbar(obj);
status.setFileNameSize(files[i].name, files[i].size);
upload(urls[i]['uploadUrl'], fd, status);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment