views:

221

answers:

2

Hi

Can I use this below Jquery form to perform file upload using post method ajax request ?

$.ajax({
    type: "POST",
    timeout: 50000,
    url: url,
    data: dataString,
    success: function(data) { alert('success');return false;} });

if it is doable, do i need to fill "data" part? is it the correct way? I only post the file to the server side.

I have been googling around, but what I found was plugin while in my plan I do not want to use it. At least for the moment.

Thanks in advance

A: 

Ajax does not support file uploads, you should use iframe instead

antyrat
how about jquery + plugin?
Willy
Yes you can try this plugin http://www.uploadify.com/
antyrat
+1  A: 

file upload is not possible through ajax. You can upload file, without refreshing page by using IFrame. you can check further detail here

Adeel
Great references. thanks mate
Willy