views:

178

answers:

2

hi....

I wud like to use file upload(ajax/javascript with php) in my form that has other controls also. when i uploaded an img it displays on the same form with delete option. if i click on submit it goes into folder as well as database & if i click on delete it deletes an img.... anybody can help me?pls u knw gmail file upload exact like that

A: 

It boils down to "Don't use XHR. Do use Flash or iframes". There are libraries that will do the heavy lifting for you.

David Dorward
the xhr doesnot support file upload.
Adeel
@Adeel — It might be possible to persuade it to send file data, but I haven't bothered looking because you can't get the file data from the user's hard disk with JavaScript… which is why my answer said not to use it.
David Dorward
@David Sorry misread the answer.
Adeel
A: 

Just use jQuery ajax upload plugin http://valums.com/ajax-upload/. It is actually not ajax, it's invisible iframe, but result is almost same.

For server-side you can use php with gd-library and some simple MySQL queries.

Mikk
It is actually Ajax. Ajax does not mean XHR.
David Dorward