How to slow down Uploadify plugin script voor jQuery
- by Peter
Now if that isn't a weird question, I don't know what is.
But here is the problem: I have a function in my "onSelect" option that has to collect some data (through AJAX) and I have a function in my "onComplete" option that processes the just uploaded files based on the data "onSelect" collected.
However, with very small files, the "onSelect" hasn't finished yet before the upload is complete and the "onComplete" fails because it lacks the necessary data. Bigger files work just fine.
So, I'm looking for a way to stall the upload of the file. To let it start only after the function in onSelect completed fetching the necessary data.
Any ideas?
Here is an example of the function that the onSelect triggers:
var foo = new Array();
function checkDB( event, queueID , fileObj )
{
$.post( ajax_folder + 'fetchData' ,
{
ref: "someValue"
} ,
function( data ){
foo[ queueID ] = data.result;
} ,
'json' );
return true;
}