0

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?

1 Answer 1

5

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

Sign up to request clarification or add additional context in comments.

1 Comment

recently valums updated their ajax upload plugin, nowadays could track bytes sent and show feedback to the user, i strongly recommend to give a try valums.com/ajax-upload

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.