Solved

Link to a doc file

Posted on 2000-03-03
4
189 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
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 the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

743 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

11 Experts available now in Live!

Get 1:1 Help Now