Upload file inside AJAX updatepanel - new solution

B

Bjorn Sagbakken

I was looking for a solution, without the full page postback, and all the
tip was about a hidden iframe and RJS.
The RJS was not known to me before, and still I haven't explored this used
with ASP.NET

But, the iframe issue gave me an idea; why not put the fileupload control &
a submit button on a form, nothing else. Then on my main form I added an
iframe, a visible one, with src=the form with the file upload control.

Ok, this shows very nice in the browser, no one will see that a small part
of the main form actually is another form. Next, on hitting the file submit
button, the file is actually uploaded to a temp folder on the server -
without the page beeing posted back! On doing this I also write the uploaded
filename to a session variable, so the "Save" button on the main form can
attach to the file for further proccessing, and finally delete the temp
file.

I am kind of new to AJAX so maybe I'm stupid, but nevertheless this approach
actually works.

Bjorn
 
B

bruce barker

this is pretty standard. most web based email systems use this for
attachments.

-- bruce (sqlwork.com)
 
B

Bjorn Sagbakken

Maybe so. Since I am quite new with AJAX, this local event still gave me a
good feeling - to re-invent a small wheel....

Bjørn
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,701
Latest member
XavierQ83

Latest Threads

Top