Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Link to a doc file

Posted on 2000-03-03
4
Medium Priority
?
223 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 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This tutorial will discuss the log-in process using WhizBase. In this article I assume you already know HTML. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you might look at some of my other articles abo…
I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Suggested Courses

783 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