Extension issue

Posted by imad77, 04-20-2009, 10:39 AM
Hi, I run a Perl/CGI script from a Web page to download some files located in a Linux server. When I click from a Windows XP on the link of the file to download via this Web page (IE), 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 ".asc", the dialog box ask me to save it only and I have not an "Open" button. I tried to configure Apache to add these extensions as text/plain by adding these lines in http.conf: AddType text/plain .asc .txt .dat How can I add these extensions (.dat, .asc and other extensions) to Apache configuration to be able to open it with Textpad or Notepad? I hope that the users will be able to open it with Notepad or TextPad without saving it. I know that we can add this type directly in the stations XP but I have a lot of users and I cannot manage that. I hope to perform it from the server. I think something is wrong or missing in my AddType, AddHandler or LoadModule? Can someone help me to fix this issue in the httpd.conf? Thanks Imad77

Posted by Ranthalas, 04-20-2009, 10:57 AM
This doesn't sound like a problem in your apache config, but rather with your windows machine. Windows doesn't know how to open or handle those files. If you want to be able to just open them in notepad you'll need to associate those filetypes with notepad in Windows. Here are some web resources on how to accomplish this: http://kb.iu.edu/data/adhc.html - windowsXP http://www.tech-recipes.com/rx/2127/..._type_program/ - Windows Vista HTH Dave

Posted by imad77, 04-20-2009, 10:59 AM
Hi, I know how to perform it from Windows, but I cannot perfom this action on all computers and I have a lot of extnesions to define. Apache provide this feature and we can do it centrally. Do you agree with me? Thanks a lot.

Posted by Ranthalas, 04-20-2009, 11:12 AM
Other than adding the application type I'm not aware of another way to do this. I know apache can tell the client what general type of file it is, but if the client doesn't know how to handle it you'll still have a problem. I'll do some sniffing around and see if I can find out any more as this is a rather intriguing question. Dave

Posted by hiabhilash, 04-20-2009, 11:38 AM
May be the linux box has compression enabled ? AFAIK, IE ignores Content-disposition if compression is enabled. But did it work with FF ?

Posted by imad77, 04-21-2009, 09:59 PM
Hi, How can I disable the compression in Linux? I tried to open these files directly in the server via a MOzilla and I get the same issue. What do you mean by FF? Thanks a lot

Was this answer helpful?

 Print this Article

Also Read

.htaccess question

Posted by MikeWalczak, 10-23-2012, 02:25 PMHey everyone, I've got a question about .htaccess. I...

Reseller Account

Posted by yachtinterac, 09-02-2002, 10:00 AMHi, Does anybody know of a company that does web...

Bizarre problem with sending/receiving emails in Outlook 2007

Posted by Azam_net, 01-11-2008, 03:46 PMThere is a strange problem with picking up and sending...

PHP Running Apps

Posted by Goldfiles, 09-09-2008, 09:31 PMI have a dedicated LAMP server at my house for personal...

Need expert to suggest me; xcache or eaccelerator?

Posted by AstroNyu, 03-27-2008, 01:46 AMHello, I have a server and I have several proxies on it...