470,596 Members | 1,528 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,596 developers. It's quick & easy.

Upload file inside AJAX updatepanel - new solution

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
Sep 26 '07 #1
2 5815
this is pretty standard. most web based email systems use this for
attachments.

-- bruce (sqlwork.com)

Bjorn Sagbakken wrote:
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

Sep 26 '07 #2
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

"bruce barker" <no****@nospam.comwrote in message
news:eB**************@TK2MSFTNGP02.phx.gbl...
this is pretty standard. most web based email systems use this for
attachments.

-- bruce (sqlwork.com)

Bjorn Sagbakken wrote:
>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

Sep 26 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Marko Vuksanovic | last post: by
1 post views Thread by Marko Vuksanovic | last post: by
3 posts views Thread by Senthil | last post: by
4 posts views Thread by Grant Merwitz | last post: by
1 post views Thread by kmithu | last post: by
11 posts views Thread by kj | last post: by
4 posts views Thread by Peter | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.