Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Can't download .doc, .rtf or .pdf (only image files).

Posted on 2004-09-21
13
Medium Priority
?
320 Views
Last Modified: 2008-03-06
I uplaod files using ASP, then list them and can download if the filename is clicked on.

This only works for .gif and .jpg.

anyone know why?

here's where i list the filenames as links:

[code]
<TABLE id="Table1" cellSpacing="1" cellPadding="1" width="75%" border="1" align="center">
                  <TR>
                        <TD width="25%" align="center"><b><i>Delete</i></b></TD>
                        <TD width="25%" align="center"><b><i>Action</i></b></TD>
                        <TD width="50%" align="center"><b><i>File</i></b></TD>
                  </TR>
                  <%
            while not rs.EOF      
                  query = "<A href=\FoodBev\UploadedFiles\" & rs("RoomID") & "\" & server.URLEncode(rs("filename")) & ">" & rs("filename") & "</a>"
                  response.write ("<tr><td align=""center""><INPUT id=""Checkbox1"" name=""remove"" type=""checkbox""  value=""" &  rs("id") & """></td><td align=""center"">" + rs("description") + "</td><td>" +  query + "</td></tr>")
            rs.MoveNext
            wend
            rs.close

            
            'end if
            
                        %>
            </TABLE>
[/code]
0
Comment
Question by:st10101
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
  • 2
13 Comments
 
LVL 10

Expert Comment

by:Jay Toops
ID: 12113514
what is the error generated when you try to DL the doc files?

JAY
0
 

Author Comment

by:st10101
ID: 12113765
"Internet Explorer cannot download posters.doc from webapps.

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

webapps is the root directory (server).

the path is correct because image files work, and i can see the path in the status bar.
0
 
LVL 10

Accepted Solution

by:
Jay Toops earned 1000 total points
ID: 12113805
Use a fully qualified url.

supply http://server/directory

also make sure from a web browser you can reach that folder
IE.. make sure http://server/dir/filename.doc will come up

it could be security is preventing that directory from being accessed

Jay
0
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 

Author Comment

by:st10101
ID: 12114570
i used the full path, still same error.

i was able to download posters.doc with firefox when i put in the full path to that document.  but when i use firefox to pull the document using the form, it doesn't work.
0
 
LVL 9

Expert Comment

by:apirnia
ID: 12117337
You should use a ServerMap path.

Lets say your ASP is at the following directory:
wwwroot/site/tools/file.asp

And your files are at the following Directory:
wwwroot/filedirectory


your path in the database that you use as link should look like this.
../filedirectory/883.doc

Couple of notes, filedirectory should be set as a virtual directory unless it is under your main site. I also realized that you used backslashes for your path. They should be forward slash.
0
 
LVL 9

Expert Comment

by:apirnia
ID: 12117364
ALmost works same as the FSO which is another way you can get all files name as testing stage befor you move to DB.

Set folder = fso.GetFolder(Server.MapPath("../../filedirectory/"))
0
 
LVL 10

Expert Comment

by:Jay Toops
ID: 12122273
maybee its because ur using urlencode on the filename and you don't need to?

do you have a link to this page i can see?
JAY
0
 

Author Comment

by:st10101
ID: 12122920
the page is on an intranet, so it is not out on the www.

i just tried to right-click and save a jpg, i got an error saying the file couldn't be written to the cache.  but if i click the link i can see the image.

i changed the slashes to forward slashes, same result.

is it really neccessary to use ServerMap?  i just want the code to work right now, i can clean it up later.  is that what ServerMap is used for? to clean up the code?

for some reason i think it's because it's an https link and not straight http.

i'll look it up..
0
 
LVL 10

Expert Comment

by:Jay Toops
ID: 12122947
try just putting the href's on a standard html page and see what happens
JAY
0
 

Author Comment

by:st10101
ID: 12123002
my problem was a browser setting:

The Do not save encrypted pages to disk check box is selected in Internet Explorer 6.0 SP1.

LINK: http://www.it-faq.pl/mskb/812/935.HTM
0
 
LVL 10

Expert Comment

by:Jay Toops
ID: 12123026
hmm Very interesting ..

Thanks for the points.

Jay
0
 

Author Comment

by:st10101
ID: 12123032
u did try to help me, thanks for the effort.

i guess u were right, it was a security thing!
0
 
LVL 10

Expert Comment

by:Jay Toops
ID: 12123190
LOL...
and we wonder why are users go banans all the time trying to use our stuff.
..

have fun
JAY
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Your data is at risk. Probably more today that at any other time in history. There are simply more people with more access to the Web with bad intentions.
Lotus Notes has been used since a very long time as an e-mail client and is very popular because of it's unmatched security. In this article we are going to learn about  RRV Bucket corruption and understand various methods to Fix "RRV Bucket Corrupt…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question