I'm using the plugin from here: http://www.uploadify.com/
I'm trying to update/add scriptData but it isn't working. The value always remains the same, what am I doing wrong!? :(
Here is the relevant code from my header..
<script type="text/javascript">
$(document).ready(function() {
$('#sampleFile').uploadify({
'uploader': 'include/uploadify/uploadify.swf',
'script': 'upload_test.php',
'scriptData': {'full_name': 'JohnDoe'},
'fileDataName': 'sampleFile',
'folder': '/work/avais/bizlists/lists',
'cancelImg': 'include/uploadify/cancel.png',
'onAllComplete' : function(){
$('#sampleFile').uploadifySettings('scriptData', { 'full_name': $('#full_name').val() });
}
});
});
</script>
I have also tried this..
<script type="text/javascript">
$(document).ready(function() {
$('#sampleFile').uploadify({
'uploader': 'include/uploadify/uploadify.swf',
'script': 'upload_test.php',
'scriptData': {'full_name': 'JohnDoe'},
'fileDataName': 'sampleFile',
'folder': '/work/avais/bizlists/lists',
'cancelImg': 'include/uploadify/cancel.png',
'onAllComplete' : function(){
$('#sampleFile').uploadifySettings('scriptData', document.getElementById('full_name').value);
}
});
});
</script>
Here is my HTML code..
<div id="upload_wrapper">
<input type="text" id="full_name" name="full_name" /><br />
<input id="sampleFile" name="sampleFile" type="file" />
<input type="button" name="upload" value="Upload" onclick="javascript:$('#sampleFile').uploadifyUpload();" />
</div>
I always get 'JohnDoe' returned by the 'full_name' POST var. :(
Thanks for any help!