Thanks, Wouldn't it be nice though to make the upload component configurable in cocoon.xconf (but i'm not sure it belongs there because it's servlet specific...
Anyway it could be configured like this: <upload-component class="org...components/upload/MultipartUpload"> <max-upload-size>10000</max-upload-size> <write-to-disk>true</write-to-disk> <conflict-handling>rename</conflict-handling> <upload-dir>incoming</upload-dir> </upload-component> Jeroen ----- Original Message ----- From: "Davanum Srinivas" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Sunday, February 24, 2002 12:30 PM Subject: replacement for maybeupload > Jeroen, > > Have made some changes in the latest CVS of Cocoon2 to make it easy to plug-in your code. Please > take a look and submit a patch against the latest CVS. Feel free to suggest how to made the > RequestFactory mode flexible so that people can add/use their own "Upload" components. > > Thanks, > dims > > > Hi, > > > > This is a replacement for the maybeupload request wrapper which i needed for > > our project. Instead of directly writing files to the upload dir the files > > are kept in the request object and can be manually stored by an action. > > > > Improvements: > > - More control over file attachments > > - Multiple upload dirs (configurable in sitemap) > > - One less optional package (i'd like the code to be put in the standard > > distro under the apache license). > > > > The following files are added / changed: > > > > org.apache.cocoon.environment.http > > - removed MaybeUpload wrapper > > - modified RequestWrapper2? to use new code > > > > org.apache.cocoon.environment.http.multipart > > - the parser and helper classes > > > > org.apache.cocoon.acting > > - added UploadAction > > > > src/webapp: > > - modified sitemap.xmap to use upload action for upload example > > > > src/webapp/docs/xsp/upload.xsp > > - modified to use upload action and removed code to list uploaded files > > (because the uploadDir constant no longer exists) > > > > build.xml: > > - removed MaybeUpload stuff > > > > I've tested the code using the upload example with: > > - Internet Explorer 6.0 (win 98) > > - Konqueror 2.2 (linux) > > - Mozilla 0.9.5 (linux) > > > > I've also tested opera 5 (linux) but, although the code works, opera does not > > post the submit field and thus the action is not executed. (I've verified > > this using the database examples which also didn't work). > > > > The patch is made against the 2.0.1 release and is divided into two parts: > > the source patch (multipart-src-patch) and the build.xml patch > > (multipart-build.xml-patch) which can both be applied using patch -p1 < > > multipart-*-patch in the cocoon 2.0.1 directory. > > > > Jeroen ter Voorde > > > ===== > Davanum Srinivas - http://jguru.com/dims/ > > __________________________________________________ > Do You Yahoo!? > Yahoo! Sports - Coverage of the 2002 Olympic Games > http://sports.yahoo.com > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, email: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]