cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Lundquist ...@wrinkledog.com>
Subject Fwd: File Uploads With Flow, per the Wiki
Date Thu, 12 Feb 2004 00:30:52 GMT

Begin forwarded message:

> From: Mark Lundquist <ml@wrinkledog.com>
> <..snip..>
>> Do I need to write out the file to disk all the same?
>
> No — you do not.  Looking at the component source code, here's how 
> it's supposed to work.  Somehow (I haven't figured out how yet), the 
> upload manager is configured with a default upload directory, which it 
> creates if it does not already exist.  What happens on the actual 
> upload depends on your autosave-uploads setting in WEB-INF/web.xml.  
> If it's set to true (the default), then the servlet container will 
> dump all uploads into a directory in the temporary webapp file (e.g. 
> if you're using Jetty, it would be something like 
> /tmp/Jetty__8888__/cocoon-files/upload-dir).  In this case, the upload 
> manager renames or copies that uploaded file into the configured 
> destination directory.  If autosave-uploads is false, then the upload 
> manager gets a stream, and it copies the data directly out of that 
> stream into the file in the destination directory.
>
> I have autosave-uploads set to true, but my upload-dir is not getting 
> touched?!  And Jetty is not reporting any errors.  Moreover, from 
> looking at the upload manager source code, I don't see how it can make 
> it out of upload() without either saving the file or throwing an 
> exception... but I'm not seeing any exceptions in the Cocoon logs.
>
> You could try setting autosave-uploads to false and restarting, then 
> doing this in the flow:
>
> 	uploader.setUploadFolder ('somewhere');
> 	uploader.upload (Part);
>
> Meanwhile, I'm going to contact the author of this code and see if he 
> can help us out!  I'll copy you on that...
>
> Cheers,
> ~ml
>

Mime
View raw message