Uploading new related objects

Author Message

Jon Staines

Monday 10 September 2007 5:48:01 am

How do you get eZ Publish to make a new object of a specific class based on the type of file that you upload?

I tried the following in upload.ini.append.php

[CreateSettings]
MimeClassMap[audio/mpeg3]=mp3_audio
MimeClassMap[audio/x-mpeg-3]=mp3_audio

[mp3_audio_ClassSettings]
FileAttribute=file
NameAttribute=name
NamePattern=<original_filename_base>

But even though it said it was of file type audio/mpeg, it was made as a file class rather than the mp3_audio class I was hoping for.

Thanks in advance for any replies.

Jon Staines

Wednesday 12 September 2007 2:14:12 am

Never mind, the answer was there in front of me. I had audio/mpeg3 when the file was audio/mpeg.

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 19:16:44
Script start
Timing: Jan 18 2025 19:16:44
Module start 'layout'
Timing: Jan 18 2025 19:16:44
Module start 'content'
Timing: Jan 18 2025 19:16:45
Module end 'content'
Timing: Jan 18 2025 19:16:45
Script end

Main resources:

Total runtime0.8582 sec
Peak memory usage4,096.0000 KB
Database Queries52

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0049 587.9141152.6250
Module start 'layout' 0.00490.0027 740.539139.4453
Module start 'content' 0.00760.8492 779.9844457.2344
Module end 'content' 0.85680.0014 1,237.21888.1641
Script end 0.8582  1,245.3828 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00290.3411160.0002
Check MTime0.00120.1378160.0001
Mysql Total
Database connection0.00070.079210.0007
Mysqli_queries0.820795.6245520.0158
Looping result0.00040.0414500.0000
Template Total0.832397.020.4161
Template load0.00210.243220.0010
Template processing0.830296.735820.4151
Template load and register function0.00010.011610.0001
states
state_id_array0.00080.088910.0008
state_identifier_array0.00100.122020.0005
Override
Cache load0.00170.1979120.0001
Sytem overhead
Fetch class attribute can translate value0.00080.093010.0008
Fetch class attribute name0.00100.112030.0003
XML
Image XML parsing0.00040.052310.0004
class_abstraction
Instantiating content class attribute0.00000.001240.0000
General
dbfile0.00060.0693160.0000
String conversion0.00000.000640.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
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 10
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs