The usage of eZContentUpload::handleLocalFile

Author Message

Kristof Coomans

Saturday 28 October 2006 8:21:31 am

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

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Kristof Coomans

Monday 04 December 2006 11:18:06 am

This also affects eZImage::insertRegularFile.

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

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

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 15:07:25
Script start
Timing: Jan 18 2025 15:07:25
Module start 'layout'
Timing: Jan 18 2025 15:07:25
Module start 'content'
Timing: Jan 18 2025 15:07:25
Module end 'content'
Timing: Jan 18 2025 15:07:25
Script end

Main resources:

Total runtime0.0187 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0065 589.4766152.6406
Module start 'layout' 0.00650.0038 742.117239.4766
Module start 'content' 0.01030.0060 781.593889.3672
Module end 'content' 0.01630.0023 870.960930.3047
Script end 0.0186  901.2656 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002614.1512140.0002
Check MTime0.00126.2457140.0001
Mysql Total
Database connection0.00105.295010.0010
Mysqli_queries0.003317.433730.0011
Looping result0.00000.122710.0000
Template Total0.00189.610.0018
Template load0.00095.031810.0009
Template processing0.00084.555210.0008
Override
Cache load0.00073.511310.0007
General
dbfile0.00052.659080.0001
String conversion0.00000.058840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_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