on 12/22/01 11:49 AM, David MacAlpine at [EMAIL PROTECTED] wrote:
> Greetings,
>
> I work in primarily mac based biology lab. Some of the molecular biology
> software we use stores the data in binary form. I've set up a web based
> database using mySQL and perl for macosx to organize some of our data. One
> problem I've run into are these darn binary data files. I would like the
> users to be able to upload the files into the database and then be able to
> retrieve them later. Currently users can upload the files, but when they
> download them they lack the creator and type information. Thus they refuse
> to open in the original application. I've found a couple of workarounds,
> but I'm not to happy whith them.
1) It is critical that the file type and creator codes be uploaded with the
files and stored in the database. Part of the upload process provides a type
and creator subfield in the field called "Content-type".
The content type header for a typical data file uploaded using Netscape will
look something like:
Content-type: application/octetstream; type:"%61%61%61%61",
creator:"%61%61%61%61"
Naturally, I just made up those values; you will have to check the actual
values uploaded by the browser. For that matter check the exact syntax,
because my memory is starting to fail. . .
B) It is critical to provide these type and creator codes in exactly the
same way when you download them. Same field: "Content-type", same subfields
and values. If you don't store the type and creator codes, you will have to
recreate them, perhaps from a file suffix (Yuck).
Note that by storing this information yourself in the database, you are
absorbing responsibility for the identification of the data, which properly
belongs in the database anyway.