Forums / Developer / Wevdav - create specific object type based on mime type

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.

eZ debug

Timing: Jan 31 2025 04:28:02
Script start
Timing: Jan 31 2025 04:28:02
Module start 'content'
Timing: Jan 31 2025 04:28:02
Module end 'content'
Timing: Jan 31 2025 04:28:02
Script end

Main resources:

Total runtime0.2126 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0057 588.0781180.8125
Module start 'content' 0.00570.0038 768.890693.8203
Module end 'content' 0.00950.2030 862.7109529.3750
Script end 0.2125  1,392.0859 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00331.5424200.0002
Check MTime0.00130.6320200.0001
Mysql Total
Database connection0.00090.436910.0009
Mysqli_queries0.165177.64951410.0012
Looping result0.00160.73501390.0000
Template Total0.202795.410.2027
Template load0.00070.350910.0007
Template processing0.202095.001610.2020
Override
Cache load0.00050.250810.0005
Sytem overhead
Fetch class attribute can translate value0.00090.404110.0009
XML
Image XML parsing0.00020.105810.0002
General
dbfile0.00683.2048200.0003
String conversion0.00000.002830.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs