|
 |
aspx_beginners thread: File Download
Message #1 by "eyetalion" <eyetalion1@h...> on Mon, 24 Feb 2003 13:44:38
|
|
I'm downloading a .PDF from my database using the code below. When I do
this, Microsoft pops up the File Download dialog box, actually it's
poping up twice. Is there a way to avoid this? I know these downloads are
safe and just want the .PDF to open up.
[code]Response.Clear()
Response.ContentType = "application/octet-stream"
Response.AddHeader("Content-
Disposition", "attachment;filename=" & Trim(pdf))
Response.BinaryWrite(objDR("bid_document"))
Response.Flush()
Response.End()[/code]
Message #2 by Colin.Montgomery@C... on Mon, 24 Feb 2003 15:28:52 -0000
|
|
do you actually have a version of Acrobat installed? If not you'll be asked
if you'd like to save it etc, as your browser doesn't know what it is.
-----Original Message-----
From: eyetalion [mailto:eyetalion1@h...]
Sent: 24 February 2003 13:45
To: aspx_beginners
Subject: [aspx_beginners] File Download
I'm downloading a .PDF from my database using the code below. When I do
this, Microsoft pops up the File Download dialog box, actually it's
poping up twice. Is there a way to avoid this? I know these downloads are
safe and just want the .PDF to open up.
[code]Response.Clear()
Response.ContentType = "application/octet-stream"
Response.AddHeader("Content-
Disposition", "attachment;filename=" & Trim(pdf))
Response.BinaryWrite(objDR("bid_document"))
Response.Flush()
Response.End()[/code]
*******
This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the
intended recipient, please telephone or email the sender and delete this message and any attachment from your system. If you are
not the intended recipient you must not copy this message or attachment or disclose the contents to any other person.
For further information about Clifford Chance please see our website at http://www.cliffordchance.com or refer to any Clifford
Chance office.
Message #3 by "eyetalion" <eyetalion1@h...> on Mon, 24 Feb 2003 17:01:55
|
|
yes, I do have Adobe installed on my PC...The .PDF does open after you
deal with dialog box...
> do you actually have a version of Acrobat installed? If not you'll be
asked
if you'd like to save it etc, as your browser doesn't know what it is.
-----Original Message-----
From: eyetalion [mailto:eyetalion1@h...]
Sent: 24 February 2003 13:45
To: aspx_beginners
Subject: [aspx_beginners] File Download
I'm downloading a .PDF from my database using the code below. When I do
this, Microsoft pops up the File Download dialog box, actually it's
poping up twice. Is there a way to avoid this? I know these downloads are
safe and just want the .PDF to open up.
[code]Response.Clear()
Response.ContentType = "application/octet-stream"
Response.AddHeader("Content-
Disposition", "attachment;filename=" & Trim(pdf))
Response.BinaryWrite(objDR("bid_document"))
Response.Flush()
Response.End()[/code]
*******
This message and any attachment are confidential and may be privileged or
otherwise protected from disclosure. If you are not the intended
recipient, please telephone or email the sender and delete this message
and any attachment from your system. If you are not the intended
recipient you must not copy this message or attachment or disclose the
contents to any other person.
For further information about Clifford Chance please see our website at
http://www.cliffordchance.com or refer to any Clifford Chance office.
Message #4 by "Peter Lanoie" <planoie@n...> on Tue, 25 Feb 2003 14:24:29 -0500
|
|
I think what you are looking for is:
Response.AddHeader "Content-Disposition", "inline;...
This should cause the PDF to open up directly in the application (Acrobat
Reader) nested in the browser (for I.E., but not Netscape, others I'm not
sure about).
Using the "attachment" disposition will force it to start a "download", thus
give you the save dialog.
Also, be careful where you have 'filename=" & Trim(pdf)'. What does the
'pdf' var contain? Is it just a simple filename (thefile.pdf)? If it is you
are fine. Someone had a problem with this same thing because they were
somehow setting the filename parameter to a full file path.
Peter
-----Original Message-----
From: eyetalion [mailto:eyetalion1@h...]
Sent: Monday, February 24, 2003 17:02
To: aspx_beginners
Subject: [aspx_beginners] RE: File Download
yes, I do have Adobe installed on my PC...The .PDF does open after you
deal with dialog box...
> do you actually have a version of Acrobat installed? If not you'll be
asked
if you'd like to save it etc, as your browser doesn't know what it is.
-----Original Message-----
From: eyetalion [mailto:eyetalion1@h...]
Sent: 24 February 2003 13:45
To: aspx_beginners
Subject: [aspx_beginners] File Download
I'm downloading a .PDF from my database using the code below. When I do
this, Microsoft pops up the File Download dialog box, actually it's
poping up twice. Is there a way to avoid this? I know these downloads are
safe and just want the .PDF to open up.
[code]Response.Clear()
Response.ContentType = "application/octet-stream"
Response.AddHeader("Content-
Disposition", "attachment;filename=" & Trim(pdf))
Response.BinaryWrite(objDR("bid_document"))
Response.Flush()
Response.End()[/code]
*******
This message and any attachment are confidential and may be privileged or
otherwise protected from disclosure. If you are not the intended
recipient, please telephone or email the sender and delete this message
and any attachment from your system. If you are not the intended
recipient you must not copy this message or attachment or disclose the
contents to any other person.
For further information about Clifford Chance please see our website at
http://www.cliffordchance.com or refer to any Clifford Chance office.
Message #5 by "eyetalion" <eyetalion1@h...> on Tue, 25 Feb 2003 20:14:43
|
|
well, that sort of worked. It's not opening up in the browser (I'm using
IE6). It's opening up with Adobe outside of the browser. I was getting
two File Download dialog boxes before, now I'm down to one,
using "inline"...I'd still like the file to just open up but, I guess I
can live with that $%$% dialog box...thanks
Message #6 by "Peter Lanoie" <planoie@n...> on Tue, 25 Feb 2003 16:55:29 -0500
|
|
You shouldn't get two dialogs. There must be something running twice.
Can't imagine what it would be without seeing all the code. You're not
redirecting to the PDF are you? I'm baffled with that one.
If you install acrobat reader, it usually installs the browser integrated
plugin for I.E. If that's not there, then surely, the PDF will only open up
in reader outside of I.E. because I.E. doesn't know how else to deal with
it. With Netscape, you always (at least in older versions) get the PDF in
the reader outside of the browser.
-----Original Message-----
From: eyetalion [mailto:eyetalion1@h...]
Sent: Tuesday, February 25, 2003 20:15
To: aspx_beginners
Subject: [aspx_beginners] RE: File Download
well, that sort of worked. It's not opening up in the browser (I'm using
IE6). It's opening up with Adobe outside of the browser. I was getting
two File Download dialog boxes before, now I'm down to one,
using "inline"...I'd still like the file to just open up but, I guess I
can live with that $%$% dialog box...thanks
|
|
 |