List Info

Thread: Odd MIME type behaviour




Odd MIME type behaviour
user name
2006-12-11 21:32:48
Hi everybody. I'm running into some weirdness in a 1.8.6
installation 
with a media type that's misbehaving. It's for Excel
spreadsheets.

In the Media Type manager, there is a MIME type set up for
the extension 
xls: "application/vnd.ms-excel"

The problem is that when I create a new media document and
upload a .xls 
file, Bricolage doesn't seem to recognize the extension. The
UI gives it 
the generic Gnome "foot" icon instead of the one I
made for Excel 
documents.

When I try to dig out the media type in a template, the
value returned 
is "application/octet-stream".

That MIME type is there in the Media Type manager, of
course, with 
several associated extensions, but xls is not among them.

There are many Excel documents in the library already, and
they DO 
display the correct icon in the UI, and they DO return the
correct value 
when I attack them with a template. The problem is just with
new media 
documents. All other media types seem to work fine.

This installation is a clone of an earlier one. I'm not 100%
sure, but I 
strongly suspect that the Excel documents I'm trying to
create now are 
the first ones since that clone process. So maybe something
went wrong then.

Anyway, a little dip into the database didn't look too odd
to me:

bric=> select * from media_type where name =
'application/vnd.ms-excel';
  id |           name           | description | active
----+--------------------------+-------------+--------
  11 | application/vnd.ms-excel |             |      1
(1 row)

bric=> select * from media_type_ext where extension =
'xls';
  id | media_type__id | extension
----+----------------+-----------
  19 |             11 | xls
(1 row)


Can anybody suggest something to try next?

Thanks,

Bret

-- 
Bret Dawson
Producer
Pectopah Productions Inc.
(416) 895-7635
bretpectopah.com
www.pectopah.com
Odd MIME type behaviour
user name
2006-12-11 21:55:04
On Dec 11, 2006, at 1:32 PM, Bret Dawson wrote:

> When I try to dig out the media type in a template, the
value  
> returned is "application/octet-stream".
>
> That MIME type is there in the Media Type manager, of
course, with  
> several associated extensions, but xls is not among
them.

Bricolage is preferring Apache's MIME type identification,
as you can  
see here:

   http://svn.bricolage.cc/bricolage/branches/rev_1
_8/lib/Bric/App/ 
Callback/Profile/Media.pm

The relevant line in the upload method is:

         $media->upload_file($fh, $filename,
$upload->type, $upload- 
 >size);

Try changing `$upload->type` to `undef`. Then please file
a bug  
report. We should just let Bricolage figure out the media
types.

Best,

David

Odd MIME type behaviour
user name
2006-12-11 22:17:32
Thanks David. That seems to completely fix the problem.

I'll file the bug report this evening.


All the best,

Bret


David E. Wheeler wrote:
> On Dec 11, 2006, at 1:32 PM, Bret Dawson wrote:
> 
>> When I try to dig out the media type in a template,
the value  
>> returned is "application/octet-stream".
>>
>> That MIME type is there in the Media Type manager,
of course, with  
>> several associated extensions, but xls is not among
them.
> 
> 
> Bricolage is preferring Apache's MIME type
identification, as you can  
> see here:
> 
>   http://svn.bricolage.cc/bricolage/branches/rev_1
_8/lib/Bric/App/ 
> Callback/Profile/Media.pm
> 
> The relevant line in the upload method is:
> 
>         $media->upload_file($fh, $filename,
$upload->type, $upload- >size);
> 
> Try changing `$upload->type` to `undef`. Then please
file a bug  report. 
> We should just let Bricolage figure out the media
types.
> 
> Best,
> 
> David
> 
> 


-- 
Bret Dawson
Producer
Pectopah Productions Inc.
(416) 895-7635
bretpectopah.com
www.pectopah.com
Odd MIME type behaviour
user name
2006-12-12 03:34:08
OK, filed as bug #1258.

Thanks again,

Bret

Bret Dawson wrote:
> Thanks David. That seems to completely fix the problem.
> 
> I'll file the bug report this evening.
> 
> 
> All the best,
> 
> Bret
> 
> 
> David E. Wheeler wrote:
> 
>> On Dec 11, 2006, at 1:32 PM, Bret Dawson wrote:
>>
>>> When I try to dig out the media type in a
template, the value  
>>> returned is
"application/octet-stream".
>>>
>>> That MIME type is there in the Media Type
manager, of course, with  
>>> several associated extensions, but xls is not
among them.
>>
>>
>>
>> Bricolage is preferring Apache's MIME type
identification, as you can  
>> see here:
>>
>>   http://svn.bricolage.cc/bricolage/branches/rev_1
_8/lib/Bric/App/ 
>> Callback/Profile/Media.pm
>>
>> The relevant line in the upload method is:
>>
>>         $media->upload_file($fh, $filename,
$upload->type, $upload- 
>> >size);
>>
>> Try changing `$upload->type` to `undef`. Then
please file a bug  
>> report. We should just let Bricolage figure out the
media types.
>>
>> Best,
>>
>> David
>>
>>
> 
> 


-- 
Bret Dawson
Producer
Pectopah Productions Inc.
(416) 895-7635
bretpectopah.com
www.pectopah.com
[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )