EZFile attribute verify mimetype ?

Author Message

H-Works Agency

Monday 14 March 2011 3:54:06 am

Hello,

How is it possible to verify the mime type of uploaded files through an ezbinaryfile (or ezfile) attribute ?

I think there is an ini file to do this but i can't find it.

Thanx in advance for any help !

EZP is Great

Donat Fritschy

Monday 14 March 2011 6:22:29 am

eZ makes it easy for you: the ezbinaryfile object extracts and shows the mime type in the mime_type attribute.

The ini file you are probably looking for is mime.ini

Hope this helps.

Donat Fritschy

http://www.webmanufaktur.ch / http://www.cjw-network.com

http://www.webmanufaktur.ch - Developers united in eZ Publish: http://www.cjw-network.com

H-Works Agency

Monday 14 March 2011 6:37:24 am

Ok i see mime.ini content but it doesn't restrict uploaded mime files type.

It only look like a dictionary of available types.

EZP is Great

Marko Žmak

Monday 14 March 2011 11:13:08 am

I'm not 100% sure but I think that by default it's not possible to restrict what mime types can be uploaded in an object's file attribute.

You'll probably have to create a custom edit handler for that.

But hey, this is good idea for an eZP enchanchement...

Note: If you're using multiupload extension you can restrict what types of files can be uploaded under which objects, but I believe this is not what you are looking for.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 02:11:32
Script start
Timing: Jan 18 2025 02:11:32
Module start 'layout'
Timing: Jan 18 2025 02:11:32
Module start 'content'
Timing: Jan 18 2025 02:11:34
Module end 'content'
Timing: Jan 18 2025 02:11:34
Script end

Main resources:

Total runtime1.3639 sec
Peak memory usage4,096.0000 KB
Database Queries63

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0050 589.0469152.6250
Module start 'layout' 0.00500.0029 741.671939.4531
Module start 'content' 0.00791.3539 781.1250599.6094
Module end 'content' 1.36180.0019 1,380.734412.1563
Script end 1.3637  1,392.8906 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.2586160.0002
Check MTime0.00150.1126160.0001
Mysql Total
Database connection0.00080.057610.0008
Mysqli_queries1.310096.0488630.0208
Looping result0.00070.0483610.0000
Template Total1.328597.420.6642
Template load0.00210.155220.0011
Template processing1.326397.244320.6632
Template load and register function0.00010.006110.0001
states
state_id_array0.00140.104710.0014
state_identifier_array0.00120.087820.0006
Override
Cache load0.00170.1257260.0001
Sytem overhead
Fetch class attribute can translate value0.00040.032530.0001
Fetch class attribute name0.00110.083170.0002
XML
Image XML parsing0.00140.104930.0005
class_abstraction
Instantiating content class attribute0.00000.000980.0000
General
dbfile0.00100.0734310.0000
String conversion0.00000.001240.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/link.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/link.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 15
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs