Image filesize restriction

Author Message

David Eriksson

Thursday 21 July 2005 2:19:44 am

Currently, it seems that you can't restrict the filesize of images to less than one megabyte. When having thousands of users, having everyone upload a 1MB image isn't feasible. It would be good if this could be set to lower values.

Another argument for this: the loading time and bandwidth requirements of the forum if everyone has a 1MB avatar.

/David

Tian DK

Monday 01 August 2005 4:13:52 am

YES! I definately second this request. My next project is a Classified Ads site where people will be uploading images of the objects they wish to sell. Could take up a lot of space if everybody uploads a 1MB file.

It would be nice if the size of the images can be restricted in steps of 50k.

Can anybody knowlegable please comment?

Thanks for a great Opensource Project! :-)

Tian DK

Friday 05 August 2005 7:38:41 am

*BUMP*

Sorry to bump, but I think this would be a valuable addition to the functionality of eZpublish.

Could save a lot of disk space on the server.

eZ systems, is this maybe planned for any upcoming releases or as a hack/extension etc?

If not, any suggestions on where to look so I can attempt to hack it myself?

Thanks!

Xavier Dutoit

Friday 05 August 2005 8:05:36 am

You can't limit the uploaded file to less than 1Mb, however, you can shrink it to whatever dimension you want, so effectively limit the size too.

That solve the pb for the download of your avatars for your forums.

If you want to save space on the server, you can also replace the uploaded file by a size reduced one by changing some parameters on the image.ini.append.php, as opposed to generate an additionnal variation. We had a thread about it a while ago in the forum.

Beware that it works better with imagemagic than with GD (I had pb with gif files if I remember right).

X+

http://www.sydesy.com

Tian DK

Wednesday 17 August 2005 3:51:18 am

Thanks for the suggestions Xavier.

It's just that it makes more sense to have the limit to be set in "kb" in stead of "MB". Then it is easy to limit it on a more granular level.

Does anybody have any idea how to hack it so that the limit is based on kb rather than MB?

Thanks!

bisk

Tuesday 23 August 2005 9:24:15 am

Easiest way is setting the upload limit in a .htaccess file bypassing the ez publish config.

100K limit:

php_value upload_max_filesize 102400

or

LimitRequestBody 102400

Only problem is that it's a limit for all uploads and not for a certain class or user. So an ez publish config. option would still be nice.

-------------------------------
http://www.kookfijn.nl & http://www.magento.be

Tian DK

Wednesday 24 August 2005 7:37:44 am

Thanks for the suggestion Bisk. As you mention, it will be nice if it is configurable to not limit all uploads, but only specific ones.

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 31 2025 00:40:35
Script start
Timing: Jan 31 2025 00:40:35
Module start 'layout'
Timing: Jan 31 2025 00:40:35
Module start 'content'
Timing: Jan 31 2025 00:40:35
Module end 'content'
Timing: Jan 31 2025 00:40:35
Script end

Main resources:

Total runtime0.0263 sec
Peak memory usage8,192.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0049 588.1328151.2109
Module start 'layout' 0.00490.0042 739.3438220.6875
Module start 'content' 0.00910.0158 960.03131,005.8203
Module end 'content' 0.02490.0014 1,965.851637.9922
Script end 0.0263  2,003.8438 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00269.7389140.0002
Check MTime0.00103.6614140.0001
Mysql Total
Database connection0.00082.993010.0008
Mysqli_queries0.00259.659230.0008
Looping result0.00000.087810.0000
Template Total0.00103.610.0010
Template load0.00082.883510.0008
Template processing0.00020.748010.0002
Override
Cache load0.00052.013210.0005
General
dbfile0.00238.875080.0003
String conversion0.00000.034440.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