Created
August 20, 2012 06:15
-
-
Save Lasha/3401523 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function() { | |
var uploadFileNames = '&'; | |
$("#file_upload").uploadify({ | |
'swf': '/uploadify/uploadify.swf', | |
'uploader': '/uploadify/uploadify.php', | |
'onUploadSuccess': function(file, data, response) { | |
alert('The file ' + file.name + ' was successfully uploaded with a response of ' + response + ':' + data); | |
uploadFileNames += 'fileNames[]=' + file.name + '&'; | |
}, | |
'onQueueComplete': function(queueData) { | |
if (queueData.uploadsSuccessful && !queueData.uploadsErrored) { | |
var formData = $('#formIDHere').serialize(); | |
$.ajax({ | |
type: "POST", | |
url: "some.php", | |
data: formData + uploadFileNames; | |
}).done(function(data) { | |
if (console && console.log) { | |
console.log("Returned Data: " + data); | |
} | |
}).fail(function(jqXHR, textStatus) { | |
alert("Request failed: " + textStatus); | |
}); | |
} | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment