Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open a Word,Excel,Text ... File

Status
Not open for further replies.

Michael42

Programmer
Oct 8, 2001
1,454
US
Hello,

If I have a file on my web server I want to open via the Browser (Word,Excel,Text,Bitmap etc.) I noticed a regular <a href="myfile.doc"> does not seem to work (file not found).

How could this be accomplished?

Thanks,

Michael42
 
Make sure that the path to the file is correct and try opening the file in a different window.
 
jwdcfdeveloper,

Thanks for the reply.

I confirmed I am opening the file using the correct path ( and also tried opening it in a new window (via target="_blank") but I am still getting the message "File Not Found".

Is there anything else I could try?

Thanks,

Michael42
 
Your link is absolutly correct. There must me something wrong with your path or file name. Or, possibly your browser won't open that file extension.


Good Luck
Lyndon
 
>> Your link is absolutly correct. There must me something wrong with your path or file name.

Thanks for confirming.

Do you think it could be something with the web server and permissions (via .htacess etc.)?

Any other guesses?

Thanks,

Michael42
 
If it was an htaccess or permissions problem, you'd get a different message, not the file not found. What is the webroot of your server? Do you have a server mapping for / to the webroot of your folder? I would imagine that if you didn't then more things would break, but I figured I'd ask anyway.

What is the code for the link (the <a href...) and the actual path on the server of the file?

MG
 
>> What is the webroot of your server?

/data (Not my invention)

My files are in: /data/appname/files

>> Do you have a server mapping for / to the webroot of your folder?

Yes

>> What is the code for the link (the <a href...) and the actual path on the server of the file?

<a href="
Do I need a mapping to /data/appname/files?

Any other suggestions???

Thanks,

Michael42
 
if you're going to do a direct path

<a href="data/appname/files/hello.doc">



A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools.
-Douglas Adams (1952-2001)
 
may have missread, is data the root folder of the web, or the first folder off of the root? if it IS the root of the whole web (not just your app) you shouldn' thave to include the data in the path name.

the best way to find out what you're missing here is to put a cfm page in the same folder as the files that can't be found. do a dump of the cgi structure and see what you get for script_name or path_info

A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools.
-Douglas Adams (1952-2001)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top