Index: openacs-4/packages/attachments/attachments.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/attachments/attachments.info,v
diff -u -r1.20 -r1.21
--- openacs-4/packages/attachments/attachments.info 7 Aug 2017 23:48:04 -0000 1.20
+++ openacs-4/packages/attachments/attachments.info 6 Dec 2018 14:26:00 -0000 1.21
@@ -8,22 +8,22 @@
t
attachments
-
+
OpenACS
Attachment support
2
2017-08-06
OpenACS
Provide widgets and datamodel to support attachments on arbitrary objects. Used by forums.
-
+
-
+
Index: openacs-4/packages/attachments/www/file-add-2.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/attachments/www/file-add-2.tcl,v
diff -u -r1.12 -r1.13
--- openacs-4/packages/attachments/www/file-add-2.tcl 6 Dec 2018 13:54:53 -0000 1.12
+++ openacs-4/packages/attachments/www/file-add-2.tcl 6 Dec 2018 14:26:00 -0000 1.13
@@ -21,7 +21,13 @@
max_size -requires {upload_file} {
set n_bytes [file size ${upload_file.tmpfile}]
- set max_bytes [parameter::get -parameter "MaximumFileSize"]
+ set root_folder [attachments::get_root_folder]
+ set fs_package_id [db_string get_fs_package_id {
+ select package_id
+ from fs_root_folders
+ where folder_id=:root_folder
+ }]
+ set max_bytes [parameter::get -package_id $fs_package_id -parameter "MaximumFileSize"]
if { $n_bytes > $max_bytes } {
# Max number of bytes is used in the error message
set max_number_of_bytes [util_commify_number $max_bytes]
@@ -39,13 +45,6 @@
set filename $upload_file
}
-set root_folder [attachments::get_root_folder]
-set fs_package_id [db_string get_fs_package_id {
- select package_id
- from fs_root_folders
- where folder_id=:root_folder
-}]
-
#db_transaction {
set file_id [db_nextval "acs_object_id_seq"]
fs::add_file \