cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geoff Howard <coc...@leverageweb.com>
Subject Re: Uploading files with Cocoon 2.1 (one more)
Date Fri, 21 Nov 2003 03:13:52 GMT
Steve Schwarz wrote:
> Josep,
> 
>> Hi Steve .... I have achieved to upload a file with your action !!!! 
>> Today
>> is a happy day !!! The problem was in the pipeline declaration....
> 
> Great I hoped it was something simple.
> 
>> 1. In the pipeline, you specifies the "upload-dir" as "incoming". It's ok
>> ... my files are saved into /cocoon/incoming/ directory. But ... what 
>> about
>> upload-directory at web.xml ??? You specify two directories: one at the
>> pipeline, and the other, at web.xml ... what's the difference???
> 
> Laziness. The example action I based my implementation on worked this 
> way. Since I only have one pipeline matcher that uses this action I 
> wasn't worried about maintenance. You might be able to access the 
> web.xml setting; but I didn't investigate how.

The significance of these configurations changed during 2.1 developement 
  and they are now somewhat misleading.  As Steve notes below, the 
directory is now really a temp-upload directory.  Files from the request 
  which still exist in that directory at the end of processing are 
deleted.  So, you can technically use that directory as your permanent 
destination directory, but it really doesn't make sense to do that any 
more and I'd recommend against it.

>> 2. When I try to upload a second file to "incoming" directory, it doesn't
>> work. It seems that only accept one file into this directory. I have 
>> turned
>> "overwrite-uploads" to "allow" at web.xml . Do you know what I have to 
>> do in
>> order to save a lot of files, with the same name (Cocoon renames 
>> "x_name" if
>> "overwrite-uploads" is turned to "rename"), into the same directory?
> 
> ??? In 2.1.x the file should only exist in the upload-dir long enough 
> for you to process it or copy it somewhere else. So immediately after 
> your pipeline completes Cocoon will delete the file from the upload-dir 
> if it is still there. Are you trying to copy your file back into the 
> upload-dir? Or are you copying it to the same name in the destination 
> directory?

This confused me as well.  Given the temporary nature of the uploads in 
2.1, overwrite-uploads will probably only be very rarely applied.  It'll 
be up to your action to handle duplicates now.

Geoff


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message