logo
Previous Thread
Next Thread
Print Thread
#280392 11/11/06 02:25 PM
Joined: Nov 2006
Posts: 5
K
Newbie
OP Offline
Newbie
K
Joined: Nov 2006
Posts: 5
I've followed the directions for the Force Download Dialog box but I receive an error message:

Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later.


Microsoft suggested I remove the AddHeader line which I did. (more documentation here )

I'm still receiving the same error. I'm very new to ASP and the little html I know is self-taught. Any assistance would be greatly appreciated!

Sponsored Post Advertisement
#280393 11/14/06 02:30 PM
Joined: Nov 2006
Posts: 5
K
Newbie
OP Offline
Newbie
K
Joined: Nov 2006
Posts: 5
40 views and no responses???


Kirstie
Xpress Assistant...providing virtual assistance for all your professional & personal needs
#280394 11/14/06 02:48 PM
Joined: Sep 2006
Posts: 7
BellaOnline Editor
Newbie
Offline
BellaOnline Editor
Newbie
Joined: Sep 2006
Posts: 7
Sorry about that. for some reason, I do not get a notification when a new post is placed. this is being worked out. With that said....

What is the error you are getting?


Christopher Combs
ASP @ BellaOnline.com
Moderator for ASP @ BellaOnline
#280395 11/14/06 03:25 PM
Joined: Nov 2006
Posts: 5
K
Newbie
OP Offline
Newbie
K
Joined: Nov 2006
Posts: 5
Thanks, Chris!

I've been testing this with a .doc file. The dialog box opens but when I try to 'save' I receive the error: "Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later."

If I choose open, I receive the error: "Internet Explorer cannot download file.doc from xpressassistant.com. The requested site is either unavailable or cannot be found. Please try again later."

I don't know if it matters but I'm using shared windows hosting thru godaddy, running asp.net 2.0. Previously I had asp 1.1 but received the same errors.

Also, I have a data file specific to my client's software. It has a .bku extension. When I try to download or open that file, I receive the following:

" <font face="Arial" size=2>
<p>ADODB.Stream</font> <font face="Arial" size=2>error '800a0bba'</font>
<p>
<font face="Arial" size=2>File could not be opened.</font>
<p>
<font face="Arial" size=2>/filedownloader.asp</font><font face="Arial" size=2>, line 38</font>"


Kirstie
Xpress Assistant...providing virtual assistance for all your professional & personal needs
#280396 11/29/06 11:02 PM
Joined: Nov 2006
Posts: 1
D
Newbie
Offline
Newbie
D
Joined: Nov 2006
Posts: 1
what happens on line 38 of filedownloader.asp?

asp.net is different than asp, you probably have asp1.1 AND asp.net 2.0

#280397 12/01/06 11:43 AM
Joined: Nov 2006
Posts: 5
K
Newbie
OP Offline
Newbie
K
Joined: Nov 2006
Posts: 5
This is the script as written by Chris:

<%
'=======================
'Define the names of your functions
'=======================
Dim Stream
Dim Contents
Dim FileName
Dim FileExt
Const adTypeBinary = 1
'=======================
'Get the actual file name from the URL that is passed to the browser
'=======================
FileName = request.querystring("filename") 'Get the name from the URL
'=======================
'GIVE AN ERROR MESSAGE IF THE URL IS EMPTY
'=======================
if FileName = "" Then
response.write "Filename Not specified."
response.end
end if
'=======================
'prevent access to certain files
'=======================
FileExt = Mid(FileName, InStrRev(FileName, ".") + 1)
select case UCase(FileExt)
Case "ASP", "ASA", "ASPX", "ASAX", "MDB"
response.write "You cannot access these file types."
response.end
end select
'=======================
'Start the download process if all is good
'=======================
response.clear
response.contentType = "application/octet-stream"
response.addheader "content-disposition", "attachment; filename=" & FileName
set stream = server.CreateObject("ADODB.Stream")
stream.type = adTypeBinary
stream.open
stream.LoadFromFile Server.MapPath("/files") & FileName
while not stream.EOS
response.BinaryWrite Stream.Read(1024 * 64)
wend
stream.Close
Set stream = Nothing
response.Flush
response.End
%>

So, if asp.net is different does that mean that this script won't execute properly? If so, do you think you could point me in the direction of a script that will work? I really appreciate the assistance.....I've received no response from Chris.


Kirstie
Xpress Assistant...providing virtual assistance for all your professional & personal needs
Joined: Feb 2007
Posts: 1
T
Newbie
Offline
Newbie
T
Joined: Feb 2007
Posts: 1
Just fell across this article on Forcing a Download. I really wish to be able to give an option to download a video I have stored on my site. Here are the conditions of my site:
download.asp is stored in folder ipod
videos are stored in ipod/videos/download
when I visit: ipod/download.asp?filename=ClockInOutEnglish_Subs.m4v to download ClockInOutEnglish_Subs.m4v, I get the following:
Quote:
The website cannot display the page
HTTP 500
Most likely causes:
The website is under maintenance.
The website has a programming error.
Here is the code I'm using:
Code:
<%
'=======================
'Define the names of your functions
'=======================
Dim Stream
Dim Contents
Dim FileName
Dim FileExt
Const adTypeBinary = 1
'=======================
'Get the actual file name from the URL that is passed to the browser
'=======================
FileName = request.querystring("filename") 'Get the name from the URL
'=======================
'GIVE AN ERROR MESSAGE IF THE URL IS EMPTY
'=======================
if FileName = "" Then
response.write "Filename Not specified."
response.end
end if
'=======================
'prevent access to certain files
'=======================
FileExt = Mid(FileName, InStrRev(FileName, ".") + 1)
select case UCase(FileExt)
Case <> "M4V"
response.write "You cannot access these file types."
response.end
end select
'=======================
'Start the download process if all is good
'=======================
response.clear
response.contentType = "application/octet-stream"
response.addheader "content-disposition", "attachment; filename=" & FileName
set stream = server.CreateObject("ADODB.Stream")
stream.type = adTypeBinary
stream.open
stream.LoadFromFile Server.MapPath("/video/download") & FileName
while not stream.EOS
response.BinaryWrite Stream.Read(1024 * 64)
wend
stream.Close
Set stream = Nothing
response.Flush
response.End
%>


>.:TUCK:.
Joined: Feb 2007
Posts: 1
N
Newbie
Offline
Newbie
N
Joined: Feb 2007
Posts: 1
I also had problems with this script. I was able to get it mostly working but calling the filename just would now work.. only if I put the actual filename in the server.mappath part. I just could not get it to work with a mappath and then the & FileName part. Drove me mad as it is a nice script and others I have found did not include the file exclusions.

I finally cracked it as below.. on the line

stream.LoadFromFile Server.MapPath("/files") & FileName

I set it thus..

stream.LoadFromFile Server.MapPath(FileName)

Now it works perfectly!

Thanks for the script.. altho it had me tearing what is left of my hair out! smile

Neil

Joined: Mar 2007
Posts: 1
S
Newbie
Offline
Newbie
S
Joined: Mar 2007
Posts: 1
Hi!

I had the same problems with this and I'm very new to asp, so was completely lost! Neil's solution solved it for me, however I really wanted the files in a separate folder from the asp page. I got round this by replacing

stream.LoadFromFile Server.MapPath("/files") & FileName

with

stream.LoadFromFile Server.MapPath("/files" & FileName)

This works too!

Thanks Neil

Sue


Moderated by  Lisa LowCarb 

Link Copied to Clipboard
Brand New Posts
Astro Women - Birthdays
by Mona - Astronomy - 04/24/24 03:37 PM
2024 - on this day in the past ...
by Mona - Astronomy - 04/24/24 03:33 PM
Check Out My New Website Selective Focus
by Angela - Drama Movies - 04/24/24 01:47 PM
Psalm for the day
by Angie - 04/23/24 04:45 PM
Inspiration Quote
by Angie - 04/23/24 04:43 PM
Sew a Garden Flag
by Cheryl - Sewing Editor - 04/17/24 01:24 PM
Review - Notion for Pattern Designers: Plan, Organ
by Digital Art and Animation - 04/17/24 12:35 AM
Review - Create a Portfolio with Adobe Indesign
by Digital Art and Animation - 04/17/24 12:32 AM
Useful Sewing Tips
by Cheryl - Sewing Editor - 04/10/24 04:55 PM
"Leave Me Alone" New Greta Garbo Documentary
by Angela - Drama Movies - 04/09/24 07:07 PM
Sponsor
Safety
We take forum safety very seriously here at BellaOnline. Please be sure to read through our Forum Guidelines. Let us know if you have any questions or comments!
Privacy
This forum uses cookies to ensure smooth navigation from page to page of a thread. If you choose to register and provide your email, that email is solely used to get your password to you and updates on any topics you choose to watch. Nothing else. Ask with any questions!


| About BellaOnline | Privacy Policy | Advertising | Become an Editor |
Website copyright © 2022 Minerva WebWorks LLC. All rights reserved.


Powered by UBB.threads™ PHP Forum Software 7.7.5