eZ Community » Forums » Developer » The usage of...
expandshrink

The usage of eZContentUpload::handleLocalFile

The usage of eZContentUpload::handleLocalFile

Saturday 28 October 2006 5:21:31 pm - 1 reply

I'm trying to use eZContentUpload::handleLocalFile from a cli script. Uploading works fine but the mime type is always application/octet-stream, also for images.

I investigated this issue a bit and it seems that eZMimeType::findByURL always returns the default mime type because the protocol is not 'file'. In other words I have to prepend the protocol file:// to the path of my file. But when I do this, the check with file_exists() fails in eZContentUpload::handleLocalFile.

Examples of paths failing:

file://F:\todo\ezpublish_migration_from_wordpress\wp-content\uploads\2006\01\me.jpg
file://F:/todo/ezpublish_migration_from_wordpress/wp-content/uploads/2006/01/me.jpg

I'm using PHP 4.4 on Windows XP.

Bug or not? Solution?

Thanks in advance for your help

Monday 04 December 2006 8:18:06 pm

This also affects eZImage::insertRegularFile.

<b>Edit:</b> Of course I meant eZBinaryFile::insertRegularFile

Modified on Saturday 17 March 2007 8:27:41 pm by Kristof Coomans

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu