我正在尝试将Uploadify 2.1.4附加到Symfony2但没有运气。当我选择要上传的文件时,会选择一个上传窗口,关闭时没有错误,但AJAX请求不会发送。包含所有必需的文件,可通过URL访问该操作。顺便说一句,我使用Zend Framework做了同样的事情,一切运作良好......
以下是我的上传代码:
$('#upload-file').uploadify(
{
uploader: '/bundles/myfile/flash/uploadify.swf',
script: '/upload-file',
cancelImg: '/bundles/myfile/images/cancel.png',
folder: '/uploads',
auto: true,
buttonImg: '/bundles/myfile/images/upload.png',
width: 48,
height: 48,
wmode: 'transparent',
fileDesc: 'Text File (*.txt)',
fileExt: '*.txt',
sizeLimit: 8000000,
multi: true,
simUploadLimit: 2
});
这是我在routing.yml中用于文件上传的路线:
upload_file:
pattern: /upload-file
defaults: { _controller: MyFileBundle:Default:uploadFile }