Subject: Telling httpd that FITS files are binary

From: thompson at orpheus.gsfc.nasa.gov (William Thompson)
Date: 24 Oct 1994 22:52:38 GMT

I remember reading somewhere that WWW browsers such as Mosaic depend on the
http server to determine what format a file is in.  Evidently, httpd thinks
that FITS files are text, probably because they start with an ASCII header.  

Unfortunately, the documentation for httpd is on http://hoohoo.ncsa.uiuc.edu/
which is (chronically) down.  Does anyone know how to tell NCSA's httpd to
treat files ending in .fits as binary files?

One clue that I have is that there is a file in the "conf" directory called
mime.types which contains lines like

	image/jpeg                     jpeg jpg jpe

Evidently, one is supposed to enter a line in this file with the MIME data type
followed by a list of extensions this will apply to.  This should be something
that will tell the browser on the other end that this is a FITS file, so that
if a suitable viewer is available (e.g. SAOIMAGE) then it will pop the file
directly into that program.

Is there any standard for what that line should be (assuming I'm guessing
right)?  My inclination is to put in something like

	application/x-fits		fits fit fts

I don't think "image/fits" is a good idea because most GIF/JPEG viewers would
not work with FITS files.

Thank you for any help you can give me,

Bill Thompson

---

From: oneel at arupa.gsfc.nasa.gov (Bruce O'Neel)
Date: Mon, 24 Oct 1994 19:42:59 -0400 (EDT)

Hi,
  You guessed correctly.  Here's what we use...
  
image/x-fits                    fit     ifits   fts     FIT
image/x-fits                    im1.fits im2.fits im3.fits img.fits
image/x-fits                    xia
image/x-fits                    xib
image/x-fits                    xic
image/x-fits                    xid
image/x-fits                    mex
image/x-fits                    img

and we have entries in our .mailcap files to spawn saoimage when it sees
these types.  We did have to modify our copy of httpd so that files for the
form im1.fits would be recognized as images and .fits by itself would be
recognized just as binary files (for us .fits in most cases are just event
lists).  Our prefered image extension name is .img.

bruce

-- 
oneel at arupa.gsfc.nasa.gov -- Bruce O'Neel HSTX (301) 286-1511 -- You can put
graphics and audio in SQL databases (as BLOBs, Binary Large OBjects), but
that's like trying to push a cow into the refrigerator -- Ted Nelson, New
Media 9/94

---

From: sla at umbra.UCSC.EDU (Steve Allen)
Date: 24 Oct 1994 23:34:18 GMT

In article <38hdrm$liv at paperboy.gsfc.nasa.gov>,
William Thompson <thompson at orpheus.gsfc.nasa.gov> wrote:
>http server to determine what format a file is in.

In answer to this, we posted the following to our internal Lick BB a while ago
%%%%%%%%%%%%%%%

---

From: thompson at orpheus.gsfc.nasa.gov (William Thompson)
Date: 25 Oct 1994 14:33:07 GMT

>image/x-fits                    im1.fits im2.fits im3.fits img.fits

It seems like a number of people want to use "image/x-fits".  I think this is a
bad idea, for several reasons.

1.  Most of the people I will be passing data to will not have a FITS-viewer,
    such as saoimage, that they can simply pass the data to.  This may reflect
    the fact that I'm in a different community, solar physics, then the normal
    "nighttime" astronomical community.  If I use "image/x-fits" then the
    default behavior will be to pass the file to xv, lview or some other
    similar viewer which will not be able to view a FITS file (at least not
    unpatched).

    More useful for my users will be to have Mosaic, etc., automatically copy
    the file to disk so that it can then be read in and processed by IDL.  I
    know that it's possible to make Mosaic do this, but I want to avoid any
    possibility of confusion or wasted bandwidth.  For simply popping an image
    up on the screen we plan to provide GIF or JPEG files.

2.  Most of our data will not be simple 2D images.  There will be a significant
    subset that will be, but the bulk of the files will be more complex than
    that.  Binary tables will be extensively used.  

Perhaps a good compromise would be to have two possible MIME types for FITS
files:

	image/x-fits		For simple images
	application/x-fits	For more general FITS files

William Thompson

---

From: thompson at orpheus.gsfc.nasa.gov (William Thompson)
Date: 25 Oct 1994 21:42:34 GMT

>	application/x-fits	For more general FITS files

I looked over again the mime.types file that came with NCSA's httpd and noticed
that there are entries for HDF and netCDF files which read

	application/x-hdf              hdf             
	application/x-netcdf           nc cdf          

Since I see FITS files as more closely related, in terms of the goals it's
trying to accomplish, to HDF and netCDF than it is to GIF and JPEG, I see this
as another argument that it should be "application/x-fits".

I've heard that there is some kind of movement underway to have FITS accepted
as a standard MIME type.  Could somebody involved in that effort comment?

William Thompson

---

From: dwells at nrao.edu (Don Wells)
Date: Wed, 26 Oct 1994 02:53:45 GMT

In article <38ju4a$ceg at paperboy.gsfc.nasa.gov>
     thompson at orpheus.gsfc.nasa.gov (William Thompson) writes:
 WT> .. I've heard that there is some kind of movement underway to
 WT> have FITS accepted as a standard MIME type.  Could somebody
 WT> involved in that effort comment? 

When I accepted the role of Chair of the IAU FITS Working Group on
August 23 at Den Haag, I presented a proposed agenda for the current
triennium. The fifth item on my list was:

\item Register FITS with the Internet (IANA) as a MIME data type.

I added this item to my list because I believed that we would soon
find a need to use MIME type codes for transmission of FITS files.
This current thread of discussion shows that my prediction was
correct!

The FITS community should continue this discussion for a while, and
should continue experimenting with type codes.  When our ideas have
stabilized, somebody can formulate a specific proposal to register one
or more codes for FITS. The proposal should be posted in
sci.astro.fits for community review. Finally, the proposed application
to IANA will be considered by the IAU FITS Working Group, and they can
authorize it by a formal vote.
--
  Donald C. Wells         Associate Scientist         dwells at nrao.edu
                    http://fits.cv.nrao.edu/~dwells
  National Radio Astronomy Observatory                +1-804-296-0277
  520 Edgemont Road,   Charlottesville, Virginia       22903-2475 USA