The problem below is that when the function is initiated, of course, MyInputVariable
is empty.
<?php $timestamp = time();?>
$(function () {
$('#file_upload').uploadifive({
'auto': false,
'dnd': true,
'checkScript': 'check-exists.php',
'formData': {
'timestamp': '<?php echo $timestamp;?>',
'token': '<?php echo md5('unique_salt' . $timestamp);?>',
'MyNumber': $('#MyInputVariable').val(),
},
'queueID': 'queue',
'uploadScript': 'upload.php',
'onUploadComplete': function(file, data) {console.log(data);}
});
});
There must be a way to instigate onUpload
, onUploadComplete
, onUploadFile
or something to update formData
, but I am at a loss as to how to do that.
Please note that this is uploadiFIVE, not uploadify. The functions/methods differ significantly, and solutions will probably not apply to both.