cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "" <>
Subject re:re: different upload-dirs for different applications
Date Tue, 30 Sep 2003 10:26:34 GMT
first -- pleast excuse my bad quoting. mail2web does not support better. :(

i'm still getting crazy trying to upload files into different directorys. i
did the solution as offered in the answer below. i inserted the example
into the standard cocoon configuration (retrieved from cocoon.war).

perhaps 1st the code.

--[sitemap.xmap begin]----

   <map:action logger="sitemap.action.request" name="upload-files"

  <map:match pattern="upload">
    <map:generate src="new-samples/fileUp.xhtml"/>
    <map:serialize type="xhtml"/>

  <map:match pattern="uploadFileFromUser">
    <map:act type="upload-files"/>
    <map:generate type="request">
    <map:read src="new-samples/success.html" mime-type="text/html"/>

  <map:match pattern="**/uploadFileFromUser">
    <map:act type="upload-files"/>
    <map:generate type="request">
    <map:read src="new-samples/success.html" mime-type="text/html"/>
-----[end of sitemap.xmap]--------------------------------------

i also changed the needed entrys in web.xml.

the "class" is quite the same than the example
given on wiki (and below). it works, it produces anoter file every time i
upload something. (i do not save the uploaded file yet.)

problem is: i still get this error after uploading the file:

"Resource not found
No pipeline matched request: uploadFileFromUser

org.apache.cocoon.ResourceNotFoundException: No pipeline matched request:

and the following stacktrace [just first 3 lines..]

org.apache.cocoon.ResourceNotFoundException: No pipeline matched request:




anyone can help me with a slightly longer explaination or a resource where
i can read (and understand it)?

best regards and thanks a lot!


--[old mails]----------------------------------------------------------
you need to create an action that has some logic in it which determines 
the application trying to save the file (eg make the applications pass a 
unique parameter in the request or so)

 From the wiki 

    public Map act(Redirector redirector, SourceResolver resolver,
                   Map objectModel, String source, Parameters par)
        throws Exception
	//use the request object below to get the additional request parameter
        Request request = ObjectModelHelper.getRequest(objectModel);
        FilePart filePart = (FilePart) request.get("uploaded_file");

        File file = ((FilePartFile)filePart).getFile();	
        getLogger().debug("Uploaded file = " + file.getCanonicalPath());
        // here you can open an InputStream on the file or whatever
        // you may also want to delete the file after using it
        return Collections.EMPTY_MAP;


action can be defined in the sitemap as following
      <map:action name="upload-files" src="your.action.package.class"

        <map:act type="upload-files">
              <map:generate type="request"/>
        </map:act> wrote:

>I have 2 applications accessing one cocoon (using different paths of
>course). Both apps need to upload Files. Is there any way to make cocoon
>save the incoming files in different directorys?
>I have seen the single-Directory solution but that does not fit my needs. 
>Any help is highly appreciated!

mail2web - Check your email from the web at .

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message