473,246 Members | 1,452 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,246 software developers and data experts.

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 5944
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Marko Vuksanovic | last post by:
I am trying to implement a file upload progress indicator (doesn't have to be a progress bar) using atlas... I do realize that the indicator cannot be implemented using Update panel control, but is...
1
by: Marko Vuksanovic | last post by:
I used the following code for implementing a file upload progress indicator, using UpdateProgress Panel, though I have a problem that FileUpload.Has File always returns false. Any suggestions what...
3
by: Senthil | last post by:
Hi all I'm new in ajax. How to upload a image using ajax..
4
by: Grant Merwitz | last post by:
Hi I am trying to implement the Microsoft Ajax.NET extensions to perform a lookup on a key press of a text box. What this will do is once a user enters a letter into the textbox, this will...
1
by: kmithu | last post by:
Hi friends, I want to upload a file on AJAX web page. The HTML code i m using is: ---------------------------------------------------------------------------------------- <asp:ScriptManager...
11
by: kj | last post by:
I would like to convert a form that currently uses the traditional CGI sequence (i.e. the action associated with the form sends a POST request to a server-side CGI script) to one that uses AJAX to...
5
by: Leon Mayne | last post by:
Having a bit of trouble here. I know that if you want to use a fileupload control inside an AJAX update panel then you need to create a trigger for the control that performs the uploading postback...
4
by: foolmelon | last post by:
Before AJAX, we were able to focus a cell in a gridview during a fullpage postback. After putting the gridview inside an UpdatePanel, we cannot focus a cell in this gridview anymore. Does anybody...
4
by: Peter | last post by:
ASP.NET 2.0 I have an AutoCompleteExtender which works fine- I am using name, id pair in the WebService , but what I am trying to do is: once the user selects an item from the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.