Solved

Link to a doc file

Posted on 2000-03-03
4
196 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
  • 3
4 Comments
 
LVL 16

Accepted Solution

by:
maneshr earned 50 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In this tutorial I will focus on how to use WhizBase as a tool for sending ICQ messages to ICQ. Here I will use a new technology in WhizBase, published in WhizBase 5.1 version. In this tutorial I will use 3 files, pager.wbsp for the processing, e…
In this tutorial I will show you how to provide a dynamic RTF document on your website generated with data from your database. For this tutorial you will need Microsoft Word or WordPad, WhizBase and Microsoft Access. In this tutorial I will show …
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

947 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now