Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Bricolage: users

mime type

 

 

Bricolage users RSS feed   Index | Next | Previous | View Threaded


zdravko.balorda at siix

Oct 20, 2009, 6:04 AM

Post #1 of 5 (115 views)
Permalink
mime type

Hi,

I'd like to add a list of related media other than images.
pdf, doc and things that users may have attached to a story.
I wonder how can I check mime type of a media, file size, etc.

Regards, Zdravko


david at kineticode

Oct 20, 2009, 9:08 AM

Post #2 of 5 (111 views)
Permalink
Re: mime type [In reply to]

On Oct 20, 2009, at 6:04 AM, Zdravko Balorda wrote:

> I'd like to add a list of related media other than images.
> pdf, doc and things that users may have attached to a story.
> I wonder how can I check mime type of a media, file size, etc.

At this time, related media elements do not have a constraint on the
type of file that can be uploaded. The best you can do is check the
media type in your templates and throw an exception on preview,
something like this:

unless ($image) {
$burner->throw_error(
'There is no image associated! Associate an image or delete
this related_media item'
) if $burner->get_mode == PREVIEW_MODE;
return;
}

# This template only handles images.
unless ($image->get_media_type->get_name =~ /^image\b/ ) {
$burner->throw_error(
'This is not an image! You should only upload an image.'
) if $burner->get_mode == PREVIEW_MODE;
return;
}

Best,

David


zdravko.balorda at siix

Oct 21, 2009, 3:30 AM

Post #3 of 5 (104 views)
Permalink
Re: mime type [In reply to]

> # This template only handles images.
> unless ($image->get_media_type->get_name =~ /^image\b/ ) {

David, tahnk you, this was just the pointer I needed.
Since I can add my own description to MIME types the
list of enclosures looks really neat.

Regards, Zdravko.


zdravko.balorda at siix

Oct 21, 2009, 7:08 AM

Post #4 of 5 (102 views)
Permalink
Re: mime type [In reply to]

David,
while at it, there is a media ending in .WAV
that is not recognized. My blind guess is that
only .wav works, not .WAV, but when I try to add
new name ending (WAV) it doesn't get saved.
This is 1.10.4. Is it a known bug?

Regards, Zdravko


greg at node79

Oct 21, 2009, 8:42 AM

Post #5 of 5 (102 views)
Permalink
Re: mime type [In reply to]

This was fixed in 1.10.7. It's a small one line fix you can try
applying to 1.10.4 if you aren't looking to upgrade yet:

http://github.com/bricoleurs/bricolage/commit/c85dc9b5ad204e8ed3c97ad71fd751a89017a3d3


--Greg

On 21 Oct 2009, at 10:08 AM, Zdravko Balorda wrote:

> David,
> while at it, there is a media ending in .WAV
> that is not recognized. My blind guess is that
> only .wav works, not .WAV, but when I try to add
> new name ending (WAV) it doesn't get saved.
> This is 1.10.4. Is it a known bug?
>
> Regards, Zdravko
>
>

Bricolage users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.