LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-25-2010, 04:10 PM   #1
HighLQ
LQ Newbie
 
Registered: May 2010
Posts: 3

Rep: Reputation: 0
Firefox "Save File" dialog for .otf font file on 1 server and not on another


I have 2 Linux servers, both Red Hat Enterprise 4.

If I visit a page with links to .otf (Opentype Font) files on a Linux server (prod) and I click on one of them, Firefox renders the font. If I visit the same page on a different Linux server (dev), I get a "Save File" prompt in Firefox.

In Internet Explorer, I get the File Save prompt from either server.

It's probably a package that the prod server has that the dev server doesn't? I'm not sure where to start looking or what to look for.

I do want the Save prompt.

Please advise.
 
Old 05-25-2010, 07:10 PM   #2
skaterase
LQ Newbie
 
Registered: Sep 2009
Distribution: slackware (current)
Posts: 7

Rep: Reputation: 1
Got something to do with MIME types perhaps. Try comparing the HTTP headers from the two servers. You can use wget:

Code:
$wget -S --spider http://devserver/font.otf
$wget -S --spider http://prodserver/font.otf
Look at Content-Type:

Btw, what version of Firefox are you using and which web server?
 
Old 05-26-2010, 08:17 AM   #3
HighLQ
LQ Newbie
 
Registered: May 2010
Posts: 3

Original Poster
Rep: Reputation: 0
Using FF 3.6
Apache

From server that prompts user to download the OTF file:

HTTP request sent, awaiting response...
HTTP/1.1 200 OK
Date: Wed, 26 May 2010 13:07:30 GMT
Server: XXX
Last-Modified: Mon, 24 May 2010 19:40:18 GMT
ETag: "336095c-6be0-35e84c80"
Accept-Ranges: bytes
Content-Length: 27616
Vary: Accept-Encoding
Connection: close
Content-Type: text/plain
X-Pad: avoid browser bug
Length: 27,616 (27K) [text/plain]

From server that renders the OTF file:

HTTP request sent, awaiting response...
HTTP/1.1 200 OK
Date: Wed, 26 May 2010 13:07:55 GMT
Server: YYY
Last-Modified: Mon, 24 May 2010 19:40:18 GMT
ETag: "336095c-6be0-35e84c80"
Accept-Ranges: bytes
Content-Length: 27616
Vary: Accept-Encoding
Connection: close
Content-Type: text/plain
X-Pad: avoid browser bug
Length: 27,616 (27K) [text/plain]

Last edited by HighLQ; 05-26-2010 at 08:18 AM.
 
Old 05-28-2010, 06:54 AM   #4
skaterase
LQ Newbie
 
Registered: Sep 2009
Distribution: slackware (current)
Posts: 7

Rep: Reputation: 1
You can try to add to the the following to either .htaccess or httpd.conf:

Code:
AddType application/octet-stream otf
This should make the Save dialog appear.

Fonts does not have defined MIME types yet, but you could replace the above with

Code:
AddType font/otf otf
for a more informative MIME type. This should result in similar behaviour as with the application/octet-stream.

The reason you get type Content-Type: text/plain is because this is the default MIME type in apache (DefaultType text/plain directive in http.conf). So if the .otf file contains text then it will be rendered by the browser. But .otf files (Opentype Font Format) is supposed to be in a binary format so this is strange.

As for the client side (firefox):

Quote:
When you click a link to download a file, the MIME type determines what action is taken. If you see an "Opening <filename>" dialog asking if you want to save the file or open it with a specified application, that normally means that no plugin is installed and enabled that can handle that MIME type and you have not previously selected a download action or helper application to always use for that type of file. Starting in Firefox 3 and SeaMonkey 2, the "Opening <filename>" dialog will also appear if you have selected "Always ask" as the action for the file's content type in your (Helper) Applications options/preferences (see below).
Source: http://kb.mozillazine.org/File_types...wnload_actions
 
Old 05-28-2010, 07:59 AM   #5
HighLQ
LQ Newbie
 
Registered: May 2010
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks! That worked.

The odd thing is that the dev server doesn't have that mime type, but it still behaves as expected.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Crash on "Open File" or "Save as File" FlyingSmurf Linux - Desktop 9 10-25-2009 02:12 AM
Hostname defined in file "network" changes after change to file "hosts" qwkfish Linux - Networking 2 10-14-2009 04:07 PM
Fedora 8 - trouble with file/"browse" dialog boxes after update... jonrpick Fedora 4 07-15-2008 01:51 PM
Get location bar in "Open File" dialog box ZeroFill Linux - Newbie 1 06-30-2006 06:10 PM
find, edit and save "startup" file chaoticanuck Linux - Newbie 2 12-19-2002 10:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration