Search code examples
jqueryuploadify

jQuery Uploadify doesn't send any request to upload.php


I have following problem with uploadify and I'm planing to use iframe. I already lost few hours without any result.

Here is my code;

$('#file').uploadify({
    'uploader'      : 'includes/js/uploadify/uploadify.swf',
    //'checkScript'     : 'includes/ajax/sales/upload.php',
    'script'        : 'includes/ajax/sales/upload.php',
    'cancelImg'     : 'includes/js/uploadify/cancel.png',
    'folder'        : 'uploads/items/',
    'multi'         : false,
    'fileExt'       : '*.xls;*.txt;*.csv',
    'fileDesc'      : 'Allowed Files',
    'buttonText'    : 'Files',
    'fileDataName'  : 'file',
    'method'        : 'post',
    'scriptData'    : {'required1':'<?php echo $required1; ?>','required2':'<?php echo $required2; ?>'},
    'sizeLimit'     : 1024 * 1024 * 5, // 5MB
    'onError'       : function (event,ID,fileObj,errorObj) {
          alert(errorObj.type + ' ERROR: ' + errorObj.info);
        },      
    'onComplete'    : function(event, ID, fileObj, response, data) {
          alert('Success!!');
        }
});
  • My upload.php works perfectly. I have tried my upload.php script just to see if it will work or not and it did work as expected.
  • I decided to add a small code to create a log file just to see if my upload.php has been executed or not. If I don't use checkScript, then there are no logs. If I use checkScript then there are logs and I can see uploadify sending request with using POST to my upload.php script with FireBug.
  • Even though it is not sending any request to upload.php, it is still showing Success!! alert.
  • Simply 'script' doesn't send absolutely any request to upload.php but strangely if I use upload2.php (file doesn't exist) then it gives me 404 error.

I'm not sure if this is a bug but it kinda seems to me like a bug considering I did follow documentation, my upload.php works as expected, my folder permissions are 777 still doesn't work.

I will be glad if anyone could point out what is this problem and how to solve it.


Solution

  • I don't know what is causing this problem, maybe browser, add-on or flash related problem. It just doesn't upload anything at all.

    So I downloaded V3.0.0 (BETA) version and everything works as expected.