开发者

AJAX file upload with Symfony

开发者 https://www.devze.com 2022-12-15 10:41 出处:网络
I am using Symfony 1.2.9 for a project, and I need to use AJAX to do file uplaod. I have not found a way of doing this yet - despite days of googling.

I am using Symfony 1.2.9 for a project, and I need to use AJAX to do file uplaod. I have not found a way of doing this yet - despite days of googling.

I am using JQuery and prototype as my javascript frameworks.

Can 开发者_StackOverflow社区anyone provide an example of how to upload a file using AJAX, in Symfony?


I don't think AJAX itself (as in XMLHTTPREQUEST) can do multipart posts - so you can't use ajax itself to do this.

You can achieve much the same affect though using either flash, or a hidden iframe. I've used swfupload before now, with symfony.

You should take a look at the sfWidgetFormInputSWFUploadPlugin plugin for an example:

http://www.symfony-project.org/plugins/sfWidgetFormInputSWFUploadPlugin

0

精彩评论

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