I need to hack limit size in image class

Author Message

Jorge estévez

Tuesday 15 April 2008 6:19:38 am

Regarding an ezpublish 3.8 site.

No matter what "limit size" I declare in my image class (from zero to any number), whenever I try to upload an image it gives me an error telling me that the image is bigger than the size I declare, so it does not allow me to upload any image.

Anyway as I am the only administrator at the site I would like to hack the system (very dirty solution indeed) so it uploads any image (with any size) and doesn't bother me again.

Where to hack seems to me the problem, so the comparison to the size of the file is skipped. Can I just delete attribute "size" at the image class?

Diseño Web Cuba
Web Design Cuba
www.elfosdesign.com

Bruce Morrison

Tuesday 15 April 2008 7:04:31 am

Hi Jorge

Sounds like it could be a php or even apache configuration issue an not an eZpublish one. What's the eror message you are seeing?

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Jorge estévez

Saturday 09 August 2008 2:41:02 am

I still neet to kow where to hack the size and allow any size. I am getting:
------------------------
El borrador no se pudo almacenar.

Falta información requerida o no es válida:

* Imagen: El tamaño del archivo subido excede el límite fijado de esta web: 1048576 bytes.
-----------------------

In english should be something like

Draft could not be saved
Required information needed
Image: The size exceeds the limit of 1048576 bytes.

Diseño Web Cuba
Web Design Cuba
www.elfosdesign.com

Jorge estévez

Saturday 09 August 2008 4:43:03 am

No matter the value of the image I set at the class definition I always get the same error:

----------------
Falta información requerida o no es válida:

* Imagen: El tamaño del archivo subido excede el límite fijado de esta web: 3145728 bytes.
--------------

It always says that the image exceeds the fixed value (in this case 3 magabytes), the same goes for 2, 4, 5 megabytes for the image....

My images are 35 kbtes, 50 kbytes....

Diseño Web Cuba
Web Design Cuba
www.elfosdesign.com

Jorge estévez

Saturday 09 August 2008 12:42:51 pm

Hello,

I did some investigation and went to: MYSITE\kernel\classes\datatypes\ezimage

And fount that ezimagetype.php checks out the size:

        if ( $canFetchResult == EZ_UPLOADEDFILE_EXCEEDS_MAX_SIZE )
        {
            $contentObjectAttribute->setValidationError( ezi18n( 'kernel/classes/datatypes',
                'The size of the uploaded file exceeds the limit set for this site: %1 bytes.' ), $maxSize );
            return EZ_INPUT_VALIDATOR_STATE_INVALID;
           
        }

So I made some comments to "return EZ_INPUT_VALIDATOR_STATE_INVALID;"

Not letting "size" be an invalid issue...

I managed to upload the image, but on the client's site the image does not show (not even a blank image), nothing at all... I should be close to a solution.

Did I miss something?

Diseño Web Cuba
Web Design Cuba
www.elfosdesign.com

André R.

Sunday 10 August 2008 7:13:33 am

You might be hacking the wrong place, one possible reason its blocked is because a value set in the form MAX_FILE_SIZE stops it.

In the image (and ezmedia and ezbinaryfile) edit attribute template you'll find this:

<input type="hidden" name="MAX_FILE_SIZE" value="{$attribute.contentclass_attribute.data_int1|mul( 1024, 1024 )}" />

code in eZHTTPFile::canFetch:

case ( UPLOAD_ERR_FORM_SIZE ):
{
    return EZ_UPLOADEDFILE_EXCEEDS_MAX_SIZE;
}break;

default:
{
    return ( $maxSize == 0 || $_FILES[$http_name]['size'] <= $maxSize )? EZ_UPLOADEDFILE_OK:
                                                                         EZ_UPLOADEDFILE_EXCEEDS_MAX_SIZE;
}

So check if the return value is actually EZ_UPLOADEDFILE_OK, if not make sure you edit the right Content class and change the upload limit value.

php doc:
http://php.net/features.file-upload.errors

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

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 19 2025 09:43:56
Script start
Timing: Jan 19 2025 09:43:56
Module start 'layout'
Timing: Jan 19 2025 09:43:56
Module start 'content'
Timing: Jan 19 2025 09:43:56
Module end 'content'
Timing: Jan 19 2025 09:43:56
Script end

Main resources:

Total runtime0.0186 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.0072 589.2813152.6406
Module start 'layout' 0.00720.0035 741.921939.4609
Module start 'content' 0.01070.0055 781.382897.4453
Module end 'content' 0.01630.0022 878.828138.3047
Script end 0.0185  917.1328 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002714.3478140.0002
Check MTime0.00126.2094140.0001
Mysql Total
Database connection0.00094.731610.0009
Mysqli_queries0.004122.185430.0014
Looping result0.00000.096410.0000
Template Total0.00189.810.0018
Template load0.00094.935910.0009
Template processing0.00094.839610.0009
Override
Cache load0.00063.293610.0006
General
dbfile0.00041.887880.0000
String conversion0.00000.063040.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