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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automatically "Save As" custom extension

Status
Not open for further replies.

wgcs

Programmer
Joined
Mar 31, 2002
Messages
2,056
Location
EC
My application uses proprietary data files, with ".plg" as an extension.

I wan't to post these on my web server for download through HTTP.
I though all I had to do was add an .htaccess file with one or both of these lines in it:
Code:
AddType     application/octet-stream .plg
AddEncoding application/octet-stream .plg

However, when viewing the URL in IE6, IE just views it as a text.

When viewing the URL in Mozilla 1.4, it opens a download dialog saying: The file "myfile.plg" is of type application/octet-stream (HTML Document), ....
And it offers to "open it with the default application (htmlfile)" or "Save it to disk".

Why do IE and Mozilla still think the file, named myfile.plg and with "Content-Type: application/octet-stream" and "Content-Encoding: applicaiton/octet-stream" in the HTTP headers is an HTML file?? How can I get both Mozilla and IE to just want to "Save As"?

- Bill

Get the best answers to your questions -- See FAQ481-4875.
 
Ok, I've found a fairly good explanation about why I'm having this problem:

But I haven't found any solution... Is there a way to specify the "Content-Disposition" header for a specific file extension using the apache .htaccess file?

- Bill

Get the best answers to your questions -- See FAQ481-4875.
 
I found a registry entry at classes\.plg with a value "Content Type" = htmlfile

This is what IE was using to override everything coming from the server, and always viewing the file. I guess I'll just have to correct this registry issue within my application.

- Bill

Get the best answers to your questions -- See FAQ481-4875.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top