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.