开发者

Valums Ajax file Upload handle the up. file?

Yes so I am using this, valums ajax fileupload: http://valums.com/ajax-upload/

With these settings:

function createUpload开发者_如何学Pythoner(){            
    var uploader = new qq.FileUploader({
        element: document.getElementById('file-uploader-demo1'),
        action: 'photo.php?mode=upload',
        debug: true
    });           
}

Not on photo.php?mode=upload, I tried to handle the file that are being uploaded, by

if(isset($_FILES['qqfile'])){
$filename = $_FILES['qqfile']['name'];
$imageSizeInfo = getimagesize($filename);
}

It doesnt execute this, no $_FILES isset.. ? Have i forgotten anything to add in the script settings? And i tried to remove the if statement, then it just says getimagesize error needs parameter cannot be empty.


Valums upload script (latest version) sends file information by ajax (xhr stream) when using Firefox, Chrome or Safari). However IE6/7/8/9 does not support it and falls back to iframe support which properly sets the $_FILES array.

If you only want to use the super global $_FILES array you can use the older version of Valums script and it will perform the same across all browsers.


there are 2 kind of methods for upload in valums script, qqUploadedFileXhr and qqUploadedFileForm. If you use example script, then you use a default one : qqUploadedFileXhr.

so, to get the files info you can use : $file_name = $_GET['qqfile']; that's it, just filename only.

but, if use the 'qqUploadedFileForm', you can get the files info :

  • $_FILES['qqfile']['name'] for filename
  • $_FILES['qqfile']['size'] for size etc
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜