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

آیا این پاسخ به شما کمک کرد؟

 پرینت این مقاله

در همین زمینه

clamscan command

Posted by persianwhois, 04-21-2009, 05:04 AMCan you please provide a clamscan ssh command for...

godaddy

Posted by cariani, 09-09-2001, 06:59 PMwww.godaddy.com is the best: 8 - 8.85 $ year for one or...

Question about suspending an account

Posted by junglecat, 06-26-2008, 05:00 PMI have WHM 11.23.0 cPanel 11.23.3-R25068 FEDORA 4 i686...

I have a WHM/cPanel server shared server...

Posted by MightWeb-Greg, 04-21-2009, 06:45 PMI just had user KILL the server using 80% CPU and...

Help me in this!

Posted by rathin, 03-28-2008, 02:19 PMHelp needed in redirection of certain browser,I haveing...