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
精彩评论