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

x
?
Solved

Link to a doc file

Posted on 2000-03-03
4
Medium Priority
?
215 Views
Last Modified: 2013-12-25
I have a Link to a WordFile which resides on the server.

When i click on the link the Word file opens in the browser window itself instead i want my browser to prompt me wheather to save or to open.

My Html Code

<A HREF="http://192.0.2.7/x.doc">Click Here to Download</A>




0
Comment
Question by:LotsOfQuestions
[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
  • 3
4 Comments
 
LVL 16

Accepted Solution

by:
maneshr earned 150 total points
ID: 2581238
try this piece of PERL code

you also need to change HMTL tag to the foll....

<A HREF="http://192.0.2.7/cgi-bin/forcesave.pl">Click Here to Download</A>
==================forcesave.pl
#!/usr/local/bin/perl

$|++;

## The full path to that doc file
$doc_file="/www/somedirectory/x.doc";

## Show some unknown MIME header
print "Content-type: junk/trash\n\n";

open(FILE,$doc_file) || die $!;
binmode (FILE); ## Read the file in binary mode

while(<FILE>){
  print $_; ## Print the content of the file
}
close(FILE):
0
 
LVL 16

Expert Comment

by:maneshr
ID: 2581242
close (FILE): should be

close(FILE);
0
 

Author Comment

by:LotsOfQuestions
ID: 2582629
That is Fine Mahesh

When the Browser prompts me i will be able to save the file to a disk when i select the "Save Option",


But What if i select the "Open Option",

When i select the "Open Option" the browser prompts me again with a
 "OPEN WITH DIALOG BOX" instead the
browser must launch the application, how do i do that.
0
 
LVL 16

Expert Comment

by:maneshr
ID: 2585276
sure. if you are using Netscape you will see a dialog box with 4 buttons. One button has the caption "Pock App..."

Click on that button, then click on Browse, let say you want that file to be opened by Excel, you just type in the full path to Excel.exe and click on OK!!

The next time whenever a file of that MIME type is being downloaded, your browser will automatically launch the app for you and open the file in it.!!

0

Featured Post

Quiz: What Do These Organizations Have In Common?

Hint: Their teams ended up taking quizzes, too.

Question has a verified solution.

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

In this tutorial I will show you how to make a simple HTML bar chart with the usage of WhizBase, If you want more information about WhizBase please read my previous articles at http://www.experts-exchange.com/ARTH_5123186.html (http://www.experts-ex…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

670 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