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

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]
st10101Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Jay ToopsConnect With a Mentor Commented:
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
 
Jay ToopsCommented:
what is the error generated when you try to DL the doc files?

JAY
0
 
st10101Author Commented:
"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
Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

 
st10101Author Commented:
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
 
apirniaCommented:
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
 
apirniaCommented:
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
 
Jay ToopsCommented:
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
 
st10101Author Commented:
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
 
Jay ToopsCommented:
try just putting the href's on a standard html page and see what happens
JAY
0
 
st10101Author Commented:
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
 
Jay ToopsCommented:
hmm Very interesting ..

Thanks for the points.

Jay
0
 
st10101Author Commented:
u did try to help me, thanks for the effort.

i guess u were right, it was a security thing!
0
 
Jay ToopsCommented:
LOL...
and we wonder why are users go banans all the time trying to use our stuff.
..

have fun
JAY
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.