Index: openacs-4/packages/file-storage/file-storage.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/file-storage.info,v diff -u -r1.60.2.9 -r1.60.2.10 --- openacs-4/packages/file-storage/file-storage.info 4 Dec 2020 10:56:19 -0000 1.60.2.9 +++ openacs-4/packages/file-storage/file-storage.info 9 Mar 2021 09:40:29 -0000 1.60.2.10 @@ -7,7 +7,7 @@ <initial-install-p>f</initial-install-p> <singleton-p>f</singleton-p> - <version name="5.10.0d10" url="http://openacs.org/repository/download/apm/file-storage-5.10.0d10.apm"> + <version name="5.10.0d11" url="http://openacs.org/repository/download/apm/file-storage-5.10.0d11.apm"> <owner url="http://openacs.org">OpenACS</owner> <summary>Collaborative document storage</summary> <release-date>2017-08-06</release-date> @@ -17,11 +17,12 @@ <maturity>2</maturity> <package_instance_name>#file-storage.file-storage#</package_instance_name> - <provides url="file-storage" version="5.10.0d10"/> + <provides url="file-storage" version="5.10.0d11"/> <requires url="acs-kernel" version="5.9.1"/> <requires url="acs-tcl" version="5.10.0d38"/> <requires url="acs-content-repository" version="5.9.1"/> <requires url="acs-automated-testing" version="5.10.0d14"/> + <requires url="acs-templating" version="5.10.0d14"/> <requires url="categories" version="1.1.3"/> <requires url="notifications" version="5.9.1"/> Index: openacs-4/packages/file-storage/www/admin/upload-size-limit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/admin/upload-size-limit.tcl,v diff -u -r1.10 -r1.10.2.1 --- openacs-4/packages/file-storage/www/admin/upload-size-limit.tcl 6 Dec 2018 15:48:10 -0000 1.10 +++ openacs-4/packages/file-storage/www/admin/upload-size-limit.tcl 9 Mar 2021 09:40:29 -0000 1.10.2.1 @@ -11,23 +11,29 @@ {return_url:localurl ""} } -set max_size [ns_config "ns/server/[ns_info server]/module/nssock" maxinput] -if {$max_size eq ""} { - set max_size 0 -} - set title "#file-storage.Configure_File_Upload_Limit#" set context [list $title] +# Get the webserver maximum file upload value. + +# Set a conservative default value of 2GB if the maximum upload value is not +# found in the webserver config. +set driver [expr {[ns_conn isconnected] ? + [ns_conn driver] : + [lindex [ns_driver names] 0]}] +set section [ns_driversection -driver $driver] +set max_size [ns_config $section maxinput 2147483648] + + set upload_limit [fs::max_upload_size] ad_form -name upload_limit_size -export folder_id -form { - {new_size:integer(text) {label "#file-storage.Upload_Limit# $max_size"} {value $upload_limit} {html { maxlength 10}}} + {new_size:integer(number) {label "#file-storage.Upload_Limit# $max_size"} {value $upload_limit} {html { min 0 max $max_size }}} {return_url:text(hidden) {value $return_url}} {submit:text(submit) {label "[_ file-storage.Change_upload_limit]"}} } -validate { {new_size - { $new_size <= $max_size } + { $max_size == 0 || $new_size <= $max_size } "#file-storage.Upload_limit_error# $max_size #file-storage.Upload_limit_error_2# "} } -on_submit {