Urgent!!!!!!!! Downlaoding attchments from a file in a new windo

G

Guest

Hi

Hope someone out there have a solution for this

Hre is my Problem:
I have a .aspx page in which i display some data along with some filenames.
These files are located on a different server.

When i click on any one of these files, i am able to downlaod them in the
same .aspx page with out any troble.

But my question is, can i downlaod the same file in a new IE window? If so
how am i supposed to do that.

Thx in advance
Sillesh
 
H

Hermit Dave

i dont see the problem
use
window.open("download.aspx?uid=" + someSortOfUniqueIdentifier +
"&DownloadFile=" + filenameToDownload);
the download.aspx file reads the file off the server and writes it to
response object.

a similar way would be to use HyperLink and set the Target property to
_blank
--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
 
G

Guest

Hi

Thx for the response. Here is my code

Dim qStr As String
qStr = "'ShowAttachment.aspx?FileNameStr=" & viewstate("Qstr") & "'"
AttachedFilePath.Attributes.Add("onclick", "window.open(" & qStr &
",null,'status=no,scrollbars=yes,help=no,resizable=yes,menubar=no');return
false;")

I want the attachment to be opend in "page_load" event of new
window('ShowAttachment.aspx) .
 
H

Hermit Dave

hold on... window.open is only executed from client side so you will need to
fire it from
<body onload="window.open('you parameters etc');>

Page_Load is serverside and window.open will have no relevance out there...

considering AttachedFilePath is a hyperlink or a button i think your code
will enable the onclick of the hyperlink / button to open the file in new
window.

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
 
G

Guest

Hi

I am calling the onclick event from server side of an "ShowInfo.aspx" page.
And "AttachedFilePath" is a hyperlink in this "ShowInfo.aspx" page. When i
click on this hyperlink, It is opening the file in the "ShowInfo.aspx" with
out any problem.

I tried to open the same file in a new window by passing the different
filename('ShowAttachment.aspx) along with the path as parameter. It is
opening a new window but is not displaying any thing.

My question is how to display the file in page_Load event of
'ShowAttachment.aspx' as it is displaying in the "ShowInfo.aspx"?

Have any idea?


Dim qStr As String
qStr = "'ShowAttachment.aspx?FileNameStr=" & viewstate("Qstr") &
"'"
AttachedFilePath.Attributes.Add("onclick", "window.open(" & qStr &
",null,'status=no,scrollbars=yes,help=no,resizable=yes,menubar=no');return
false;")
 
B

bruce barker

note: this code will not work with a popup blocker. you should use an anchor
with target.

-- bruce (sqlwork.com)
 

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

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top