Forums / General / I need to hack limit size in image class

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

eZ debug

Timing: Jan 19 2025 09:07:21
Script start
Timing: Jan 19 2025 09:07:21
Module start 'content'
Timing: Jan 19 2025 09:07:23
Module end 'content'
Timing: Jan 19 2025 09:07:23
Script end

Main resources:

Total runtime2.0663 sec
Peak memory usage4,096.0000 KB
Database Queries205

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0064 589.0625180.8203
Module start 'content' 0.00641.9266 769.8828632.0000
Module end 'content' 1.93300.1332 1,401.8828341.0781
Script end 2.0663  1,742.9609 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00420.2053210.0002
Check MTime0.00160.0762210.0001
Mysql Total
Database connection0.00080.038210.0008
Mysqli_queries1.974195.53462050.0096
Looping result0.00240.11482030.0000
Template Total2.035598.521.0178
Template load0.00210.101420.0010
Template processing2.033498.405821.0167
Template load and register function0.00050.022810.0005
states
state_id_array0.00130.064710.0013
state_identifier_array0.00190.089720.0009
Override
Cache load0.00180.0854510.0000
Sytem overhead
Fetch class attribute can translate value0.00160.078940.0004
Fetch class attribute name0.00140.067480.0002
XML
Image XML parsing0.00180.087640.0005
class_abstraction
Instantiating content class attribute0.00000.000880.0000
General
dbfile0.00470.2297340.0001
String conversion0.00000.000330.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
15content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
7content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 35
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs