Forums / Suggestions / Image filesize restriction

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.

eZ debug

Timing: Jan 18 2025 11:12:34
Script start
Timing: Jan 18 2025 11:12:34
Module start 'content'
Timing: Jan 18 2025 11:12:35
Module end 'content'
Timing: Jan 18 2025 11:12:36
Script end

Main resources:

Total runtime1.1991 sec
Peak memory usage4,096.0000 KB
Database Queries210

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0087 587.7109180.8359
Module start 'content' 0.00870.9915 768.5469655.9844
Module end 'content' 1.00020.1989 1,424.5313342.8672
Script end 1.1990  1,767.3984 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00410.3433210.0002
Check MTime0.00160.1374210.0001
Mysql Total
Database connection0.00140.116210.0014
Mysqli_queries1.105692.20402100.0053
Looping result0.00250.20782080.0000
Template Total1.165897.220.5829
Template load0.00210.176120.0011
Template processing1.163797.044720.5818
Template load and register function0.00010.012010.0001
states
state_id_array0.00190.161710.0019
state_identifier_array0.00180.152420.0009
Override
Cache load0.00190.1573400.0000
Sytem overhead
Fetch class attribute can translate value0.00170.138950.0003
Fetch class attribute name0.00160.135990.0002
XML
Image XML parsing0.00420.351450.0008
class_abstraction
Instantiating content class attribute0.00000.0026120.0000
General
dbfile0.00550.4582330.0002
String conversion0.00000.000830.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
7content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/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: 23
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs