Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 325
  • Last Modified:

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]
0
st10101
Asked:
st10101
  • 6
  • 5
  • 2
1 Solution
 
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
 
Jay ToopsCommented:
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 6
  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now