The problem below is that when the function is initiated, of course, MyInputVariable is empty.
$(function ()
After many hours of experimentation with misleading solutions on the uplodifive forum, this is the solution.
In your HTML anchor tag:
Upload Files
Change the anchor tag to:
Upload Files
Completely eliminate the formData setting from the initial function call so it then looks something like this:
$(function()
{
$('#file_upload').uploadifive(
{
'auto' : false,
'dnd' : true,
'checkScript' : 'check-exists.php',
'queueID' : 'queue',
'uploadScript' : 'upload.php',
'onUploadComplete' : function(file, data) {console.log(data);}
});
});
Than add this function:
function uploadFiles()
{
$('#file_upload').data('uploadifive').settings.formData =
{
'timestamp' : '',
'token' : '',
'MyNumber' : $('#MyInputVariable').val()
},
$('#file_upload').uploadifive('upload');
}
And whatever other variables you need to add. Your input variables will now post on upload.