Forum .LRN Q&A: 2 mg max file upload?

Collapse
Posted by William Painter on
For some reason, I can't find the variable to change the max size of the file for uploading in .LRN. I have changed it in the OpenACS but it hasn't altered the File Storage package in dotLRN.

Any suggestions as to where to look?

Collapse
2: Re: 2 mg max file upload? (response to 1)
Posted by Rocael Hernández Rizzardini on
look at the parameters of your fs instance at the site-map ...
Collapse
3: Re: 2 mg max file upload? (response to 1)
Posted by Bruno Mattarollo on

I seem to recall a new parameter called maxinput in AOLServer 4.x that might be something I would look into if using AOLServer 4.

Hope this helps.

Collapse
4: Re: 2 mg max file upload? (response to 1)
Posted by William Painter on
Thanks for the help, but I had already ammended the config.tcl file to include ns_param maxinput 41943040 which had an effect on the File Storage portelet of the ACS site but not on the communities, classes, clubs, etc., of .LRN

Instead, I searched through all the files and found that file-add-2.tcl contained a line:

if { $n_bytes > $max_bytes }

That variable, max_bytes, referred to the MaximumFileSize parameter noted in file-storage.info and although I changed the number of that parameter, it, too, had no effect.

So, I commented out the lines in file-add-2.tcl and that means that there is no top limit to the file size. It "works" in that I can now upload larger files, but it isn't a proper fix.

Thanks for the help! If anyone has a better solution, I am all ears.

-wp

Collapse
5: Re: 2 mg max file upload? (response to 1)
Posted by Bruce Spear on
I'm not the expert on this, but when I confronted this problem setting up Dotlrn last year I found the problem of maximim file size to lie not in Dotlrn, but in Aolserver, and in my present aolserver 4 frontend.tcl file (I have a virtual name server setup) I now find this note and line:

#---------------------------------to increase max file size ns_section ns/module/nssock

ns_param maxinput [expr 1024 * 1024 * 10]

I hope this at least helps you figure out where to look!

Bruce

Collapse
6: Re: 2 mg max file upload? (response to 1)
Posted by Bruce Spear on
PS: you need to restart aolserver to put this new value into effect.
Collapse
7: Re: 2 mg max file upload? (response to 1)
Posted by William Painter on
Yeah, I tried that fix too and it worked for MyFiles but not for club file storage. Here are the precise lines I commented out:

max_size -requires {upload_file} {
        set n_bytes [file size ${upload_file.tmpfile}]
        set max_bytes [ad_parameter "MaximumFileSize"]
        #if { $n_bytes > $max_bytes } {
        #    ad_complain [_ file-storage.lt_Your_file_is_larger_t_1 [list max_number_of_bytes [util_commify_number $max_bytes]]]
        #}

The file is /var/lib/aolserver/$servername/packages/file-storage/www/file-add-2.tcl

The parameter for $max_bytes is set in /file-storage/file-storage.info and is expressed:

<parameter datatype="number"  min_n_values="1"  max_n_values="1"  name="MaximumFileSize"  default="10000000" description="The maximum size, in bytes, of files that users are allowed to upload"/>

The original was 2000000 and I upped that to no effect (that's why the number is so high above). I would like to have a ceiling on the file size just out of caution but, for now, this seems to work.

Collapse
8: Re: 2 mg max file upload? (response to 1)
Posted by Bruno Mattarollo on

William,

Did you restart your server so that it would load the new parameter? Also, could you try to put a debug line that would log the value of both $n_bytes and $max_bytes?

Something like:

ns_log "Warning" "WARNING DEBUG>>>> n_bytes: $n_bytes ;; max_bytes: $max_bytes"

And check what are the values that are being checked.

Just my 2 cents,

/B