Forum OpenACS Q&A: File Storage: can't upload large files

Hello,

I tried to upload files in .LRN2. In the file storage package's parameters, I entered a large MaximumFileSize. But files > some hundred Kb are not uploaded. There is a message like "file has no content" from the browser.

Do you think this is a problem of the browser (Mozilla 1.5, Windows) or of OpenACS? (Ok, I could have checked with another browser myself)

There is a parameter in file storage "StoreFilesInDatabaseP" which is set to 1 by default, and I don't know how to change it because it says ***This parameter should only be changed at package instance creation.*** and when .LRN is installed, the package instance is already created. Actually I don't see much reason why large files should be stored in the database. We want to distribute mp3 recordings of lectures to our students. Size is about 10 MB each.

Thanks for any help
Christof

Collapse
Posted by Christof Spitz on
Internet Explorer uploads the file, and when the progress bar is at 100% there comes an error message: "Page cannot be shown". So it's basically the same as with Mozilla.
Collapse
Posted by Dave Bauer on
What version of AOLserver are you using?

In AOLserver 4 there is a maxinput parameter. It defaults to 1mb.

ns_section ns/server/${server}/module/nssock

ns_param  maxinput          [expr 4000 * 1024]

Dave

Collapse
Posted by Christof Spitz on
Thanks a lot, Dave. I use aolserver 4. I added the parameter and it works fine.

When googling for "ns_param maxinput" I found the same info at sourceforge, and it also says:

> Be aware that if you expect large requests (to support file uploads, for example), you may need to specify a receive timeout.  This defaults to 30 seconds.  The parameter for this is named 'recvwait' within the socket driver module and is specified in seconds. <

So for uploading large mp3 files and other stuff via DSL one should also add e.g.

ns_param recvwait [expr 20 * 60]

for 20 min. timeout.

Collapse
Posted by Mark Aufflick on
Cool - I had found the first param but not the second one.

This should make it's way into the standard config file with a comment. THe way that the connection is silently dropped leads your trouhleshooting down the wrong path.

IMO nsd should return a useful error (if that is possible given the upload connection).

Collapse
Posted by Randy O'Meara on
I've seen several people stumble over this issue in the last few months. Maybe the config file should be changed to have more reasonable (larger) default values?

/R

Collapse
Posted by Malte Sussdorff on
The parameters are (now) in config.tcl on 5-1 and are set to 5MB and 2 minutes.
Collapse
Posted by Randy O'Meara on
Great, Multi. That should smooth the path a bit for others.

Dave B (or the keeper of file-storage): should the default file-storage MaximumFileSize param be bumped to 5MB also? Just to be consistent...

/R

Collapse
Posted by Randy O'Meara on
Oops. I really meant Malte but I was talking at the same time. I guess I'm not a Multi-processor...

/R

Collapse
Posted by Steve Manning on
In addition to the maxinput specified for http connections, you also need a separate maxinput for https connections. Dossy posted this on the AOLserver list this week:

------------------------------------------------
...if you're using nsopenssl,you may think that a similar config section like this should work:
    ns_section "ns/server/${servername}/module/nsopenssl"     
    ns_param   maxinput              [expr 1024 * 1024 * 100]

But, it doesn't!  (Ross Simpson and I found this out the hard way, with
two hours of much gnarly debugging and head-scratching.) So, how DO you
set "maxinput" for nsopenssl? Well, nsopenssl has a "ssldrivers" config section, that might look like
the following:

    ns_section "ns/server/${servername}/module/nsopenssl/ssldrivers"    
    ns_param example   "an example server"That defines the ssldriver named "example".  

You set parameters for it(like you do for nssock) in this config section:    

   ns_section "ns/server/${servername}/module/nsopenssl/ssldriver/example"   
   ns_param   sslcontext            example_ctx    
   ns_param   port                  443    
   # ... etc ...    
   ns_param   maxinput              [expr 1024 * 1024 * 100]

Yes, you define parameters like "maxinput" and "recvwait" and other
socket-related settings in THIS section! Yes, this is where those
settings belong. Interesting bug: in at least nsopenssl (and perhaps nssock),
if maxinput is reached, the server seems to sleep or simply spin, instead of
returning some kind of error ("400 Bad Request / request exceedsmaxinput" or somesuch).  

So, the diagnostic behavior is if you'reuploading a large file that exceeds maxinput, the browser just appears
to be still sending the file and it never finishes (until "recvwait"seconds elapse, I believe).

-- Dossy--Dossy Shiobara                       
mail: dossy@panoptic.comPanoptic Computer Network             web: http://www.panoptic.com/  
---------------------------------------------------------

- Steve