Link directly to MS Word document

W

W. de Jonge

Who can help me? I want to create a link(href) which opens an .doc or an
..xls directly in MS Word or MS Excell and not in IE so that I don't have to
save the document first en open it from Explorer.

I asked our webmaster at the office but he didn't know the answer so I hope
you can help me.

Greetz

Willem
 
D

David Ross

W. de Jonge said:
Who can help me? I want to create a link(href) which opens an .doc or an
.xls directly in MS Word or MS Excell and not in IE so that I don't have to
save the document first en open it from Explorer.

I asked our webmaster at the office but he didn't know the answer so I hope
you can help me.

Upload the Word or Excel file to the Web server in binary mode.
Create a standard link of the form <a href="xxx">yyy</a>. The xxx
should have the .doc or .xls extension found on the Word or Excel
file.

Your Webmaster might have to put an entry in the Web server's
..htaccess file for doc and xls. For that, he should consult the
documentation for the server software. However, I would expect
that the standard .htaccess file that came with the server already
has such entries if they are needed.

--

David E. Ross
<URL:http://www.rossde.com/>

I use Mozilla as my Web browser because I want a browser that
complies with Web standards. See <URL:http://www.mozilla.org/>.
 
A

Andy Dingley

Upload the Word or Excel file to the Web server in binary mode.

Hmm... Don't we upload _everything_ in binary mode these days ?

What happens to "ftp ASCII upload" in this world of XML, UTF-16 etc. ?
Should we be worrying about this ?

And doesn't everyone just have broadband these days and more bandwidth
than the whole of IBM did until a few years ago,
 
N

Neredbojias

With neither quill nor qualm, W. de Jonge quothed:
Who can help me? I want to create a link(href) which opens an .doc or an
.xls directly in MS Word or MS Excell and not in IE so that I don't have to
save the document first en open it from Explorer.

I don't know, but is your nickname "Shrimp"?
 
D

Dan

W. de Jonge said:
Who can help me? I want to create a link(href) which opens an .doc or an
.xls directly in MS Word or MS Excell and not in IE so that I don't have to
save the document first en open it from Explorer.

That is not something you have complete control over; it's up to the
end-user's configuration. Your task is to ensure that the documents in
question are served with a proper MIME type indicating what sort of
data they are; then the user's system might display them inline if
their browser supports it, launch an external helper application, or
prompt to save it.

The end user might just not have *anything* from Microsoft on his/her
system, so it could be that the use of proprietary Word and Excel
formats results in the site being completely inaccessible to him/her.
 
D

David Ross

Andy said:
Hmm... Don't we upload _everything_ in binary mode these days ?

What happens to "ftp ASCII upload" in this world of XML, UTF-16 etc. ?
Should we be worrying about this ?

And doesn't everyone just have broadband these days and more bandwidth
than the whole of IBM did until a few years ago,

I still upload HTML and CSS files in ASCII mode. I also upload my
UNIX scripts (KSH coded in Wordpad) and ASCII files (TXT) in ASCII
mode. The reason is that I want these files to reside on my Web
server (a UNIX system) with UNIX-type end-of-line (EOL) markings
(LF), not PC-Windows-type EOL markings (CR/LF). FTP converts the
EOL markings from the source type to the destination type when
doing ASCII transfers. This allows me to edit the files on the
server (via a secure Telnet session) using UNIX tools.

I still use a dial-up connection to the Internet. Late last year,
I saw a news item that said almost half of those in the U.S. who
access the Internet from home do so via dial-up modems. This
number might actually increase soon, now that the courts have ruled
that phone and cable TV companies can charge independent ISPs
retail rates for broadband. This means that, if I want broadband,
I must either use Adelphia or SBC for my ISP; or I must pay them
for an unused ISP account merely to get broadband to my current
ISP. I like my current ISP and don't want to change. But I also
don't want to pay for two ISP accounts to use only one.

--

David E. Ross
<URL:http://www.rossde.com/>

I use Mozilla as my Web browser because I want a browser that
complies with Web standards. See <URL:http://www.mozilla.org/>.
 
J

Jim Moe

W. de Jonge said:
Who can help me? I want to create a link(href) which opens an .doc or an
.xls directly in MS Word or MS Excell and not in IE so that I don't have to
save the document first en open it from Explorer.

I asked our webmaster at the office but he didn't know the answer so I hope
you can help me.
This depends on both the server and the browser. The server must send
the document with a appropriate "Content-Type" header entry, such as
application/msword for Word documents. Then your browser must have a
corresponding entry to call the appropriate application to view the document.
For instance, in Mozilla go to Edit: Preferences...: Navigator:
Helper_Applications to see what is configured there.
Firefox just asks you what application to use for an unknown file type.
 
J

Jim Michaels

for a file download to be forced, you are going to have to send headers
before the file is sent out. you will need ASP or PHP. taken from
http://www.php.net/manual/en/function.header.php


<?php
// We'll be outputting a PDF
header('Content-type: application/msword'); //or application/vnd.ms-excel

// It will be called downloaded.doc
header('Content-Disposition: attachment; filename="downloaded.doc"');

// The PDF source is in original.doc
readfile('original.doc');
?>

this will allow the file to be opened as an option.
 
D

Dan

Jim said:
for a file download to be forced, you are going to have to send headers
before the file is sent out. you will need ASP or PHP. taken from
http://www.php.net/manual/en/function.header.php

That still won't *force* anything, only suggest it.
<?php
// We'll be outputting a PDF
header('Content-type: application/msword'); //or application/vnd.ms-excel

If you're outputting a PDF, then it wouldn't make very much sense to
send the content-type header for MS Word or Excel, would it?

Don't top-post.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,001
Messages
2,570,254
Members
46,849
Latest member
Fira

Latest Threads

Top