Stick it to THE MAN
Stick it to THE MAN

Reputation: 5721

AJAX file upload with Symfony

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 anyone provide an example of how to upload a file using AJAX, in Symfony?

Upvotes: 0

Views: 5689

Answers (1)

benlumley
benlumley

Reputation: 11382

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

Upvotes: 5

Related Questions