php环境下使用Ext.ux.UploadDialog 的问题
sailer
2008-07-25
我的upload-dialog.js中设置对话框的代码:
function getDialog() { if (!dialog) { dialog = new Ext.ux.UploadDialog.Dialog({ url: 'upload-dialog-request.php', reset_on_hide: false, allow_close_on_upload: true, upload_autostart: false, //true, post_var_name: 'upload', title: '图片上传', permitted_extensions:['JPG','jpg','jpeg','JPEG','GIF','gif'] //minWidth: 400, //minHeight: 200, //width: 400, //height: 350 }); dialog.on('uploadsuccess', onUploadSuccess); //dialog.on('beforefileuploadstart', onBeforeFileUploadStart); } return dialog; } upload-dialog-request.php的内容(来自这篇blog:http://zjnbshifox.iteye.com/blog/123399): $file = ""; $result = array(); $ext = strrchr($_FILES["file"]["name"],'.'); $file = "". date("YmdHis") . $ext; if(move_uploaded_file($_FILES["file"]["tmp_name"],"uploadIDPic/" . $file)){ $result = array('success'=>true,data=>$file); }else{ $result = array('success'=> false, 'error'=> '文件上传错误'); } echo json_encode($result); 但是我上传总是失败,我发现upload-dialog-request.php中$ext的值总是为空,感觉这个php程序没有得到上传的文件名,不知道如何解决? |