Wevdav - create specific object type based on mime type

Author Message

Stig Tidemandsen

Friday 03 November 2006 6:46:47 am

I have a larger amount of flv-files and mp3-files I want to upload to a site with webdav. However, I want the mp3-files to be stored as [sound]-objects and the flv-files to be stored as [video]-objects.

Based on the mime-types I've put this in upload.ini.append.php:
[CreateSettings]
MimeClassMap[audio/mpeg]=sound
MimeClassMap[video/x-flv]=video

[sound_ClassSettings]
FileAttribute=file
NameAttribute=name
NamePattern=<original_filename>

[video_ClassSettings]
FileAttribute=file
NameAttribute=name
NamePattern=<original_filename>

The files are uploaded and the objects are created. The mp3-files are stored as [sound]-objects and flv-files are stored as [video]-objects. So far so good.

But when I go to the webdav created object in the admin interface the link pointing to the file gives me a 404. I should point out that this works perfectly if I upload an mp3-file through the admin interface.

Because of this I can't make a regular download link for the mp3's if they're uploaded through webdav.

I've done some research and so far I've noticed some things that could be related to my problem:
- The files uploaded through webdav is stored in the same location as they would have been through the admin interface.
- The files uploaded through webdav has no extension while files uploaded through the admin interface keeps their extension.
- If I try to download a file uploaded with webdav back to the client with webdav, the file is named ie: brady_bunch.mp3.mpga

I've also looked in ezbinaryfile table:
Uploaded through admin interface:
filename | mime_type | original_filename
f1eda731853dda974431e6b031d378de.mp3 | audio/mpeg | Lost.mp3
b4158aa05d95a021cbeffc1ff1ed7b85.flv | application/octet-stream | VIDEO_TS_Title_03VP6_512K_Stream.flv

Uploaded through webdav:
filename | mime_type | original_filename
f89b778295dca27110926c6afc8efe6e | audio/mpeg | Brady_Bunch.mp3
a643323debf3c228cbbfbca6a145f72d | video/x-flv | HIT saltoVP6_512K_Stream.flv

Can anyone help me out here?
Is my upload.ini.append.php way off, or is this a bug?

I'm currently using eZ Publish 3.8.6, but I've also tried this on 3.8.4.

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 22:27:39
Script start
Timing: Jan 18 2025 22:27:39
Module start 'layout'
Timing: Jan 18 2025 22:27:39
Module start 'content'
Timing: Jan 18 2025 22:27:40
Module end 'content'
Timing: Jan 18 2025 22:27:40
Script end

Main resources:

Total runtime0.7482 sec
Peak memory usage4,096.0000 KB
Database Queries46

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0075 588.1406152.6406
Module start 'layout' 0.00750.0048 740.781339.4766
Module start 'content' 0.01230.7344 780.2578419.6797
Module end 'content' 0.74670.0015 1,199.93758.1250
Script end 0.7482  1,208.0625 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.4718160.0002
Check MTime0.00130.1799160.0001
Mysql Total
Database connection0.00090.122010.0009
Mysqli_queries0.701593.7572460.0152
Looping result0.00040.0584440.0000
Template Total0.709894.920.3549
Template load0.00200.272620.0010
Template processing0.707894.598420.3539
Template load and register function0.00020.024110.0002
states
state_id_array0.00190.258110.0019
state_identifier_array0.00210.284220.0011
Override
Cache load0.00170.2260350.0000
Sytem overhead
Fetch class attribute can translate value0.00060.077910.0006
Fetch class attribute name0.00080.105410.0008
XML
Image XML parsing0.00010.013510.0001
class_abstraction
Instantiating content class attribute0.00000.000510.0000
General
dbfile0.00070.0870100.0001
String conversion0.00000.001640.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
1content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
7content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 18
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs