Upload problem (ez-publish 3.9.2)

Upload problem (ez-publish 3.9.2)

Wednesday 21 May 2008 2:39:59 am - 5 replies

Modified on Wednesday 21 May 2008 2:42:39 am by Jacques Feix

Author Message

André R.

Wednesday 21 May 2008 3:57:25 am

Is the file bigger then what you allow in php settings?

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Jacques Feix

Wednesday 21 May 2008 4:59:31 am

Hi André,
I thought about it, but my file is only 154 ko
Also, I can upload it when I create a new "file" object

André R.

Wednesday 21 May 2008 5:36:12 am

Beats me, try this upload code from Oe ('fileName' is name on file input):

include_once( 'kernel/classes/ezcontentupload.php' );
$upload = new eZContentUpload();

$location = false;
if ( $http->hasPostVariable( 'location' ) )
{
    $location = $http->postVariable( 'location' );
    if ( $location === 'auto' || trim( $location ) === '' ) $location = false;
}

$objectName = '';
if ( $http->hasPostVariable( 'objectName' ) )
{
    $objectName = trim( $http->postVariable( 'objectName' ) );
}

$uploadedOk = $upload->handleUpload( $result, 'fileName', $location, false, $objectName );


if ( $uploadedOk )
{
    $newObject = $result['contentobject'];
    $newObjectID = $newObject->attribute( 'id' );
    //and so on
}
else
{
    foreach( $result['errors'] as $err )
        echo $err['description'] . '<br />';
}

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Jacques Feix

Wednesday 21 May 2008 6:23:07 am

André,
I can't use your code. each time the "handleUpload" function return an error :

the problem is here :

$locationOK = $this->detectLocations( $classIdentifier, $class, $location, $parentNodes, $parentMainNode );

I tried 'auto', and a correct nodeID for $location but it doesn't work
Also, I am not really interested by creating an eZPublish object with my file, I just want to upload it ...

thx,

Jacques Feix

Wednesday 21 May 2008 8:15:54 am

oupsssss
My firefox has a problem, when I do it with IE it is ok ...

Sorry for this post ..
:)

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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.