Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

open files with some extensions

Status
Not open for further replies.

imad77

Instructor
Oct 18, 2008
97
CA
Hi,

I run a script from a Web page to download a file, this Perl script and these files to download are located in Linux server. When I click on the link of the file to download from a Windows station via this Web page , a dialog box will be displayed to ask me to "Open" or "Save" the file (.txt, .doc, .xls) but for some extensions like ".dat" or ".xml", the dialog box ask me to save it only and I have not an "Open" button.


How can I add these extensions (.dat and .xml) to my script to be able to open it with Textpad or Notepad?

Can someone help me to fix this issue?


Thanks

here is a part of the script:
======================

open(BFILE, '<', "$file") or return(0);
print $q->header(-type => 'application/x-download',
-attachment => "$file",
'Content-length' => -s "$file"
);
binmode BFILE;
while ( <BFILE> ) {
$ln=$_; $ln =~ s/\n/\r\n/g; print $ln;
}

close (BFILE);
 
Windows uses file associations to determine what application to use to open a file, that is a local Windows setting, nothing to do with perl or CGI in general.

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top