cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeremy Aston" <>
Subject RE: File Upload using action or any other approach
Date Wed, 17 Apr 2002 05:54:05 GMT

Hi Chiths

Just in case you missed my posting please see the following on cocoon-dev - .  It
basically does what you want.  I am tidying the code up and adding some
extra bits for my own purposes but the code works.  If you want to specify
the upload dir from a parameter on the page or from some other source such
as the session then the following modification to the sitemap match will let
you do that e.g:

<map:match pattern="xsp/upload">
<map:act type="request">
		<map:parameter name="parameters" value="true"/>
	<map:act type="file-upload">
			<map:parameter name="upload-dir" value="{upload-dir}" />
			<map:generate src="docs/samples/xsp/upload.xsp" type="serverpages" />
		<map:transform src="stylesheets/dynamic-page2html.xsl" />
		<map:serialize />


Just in case you are wondering...  Cocoon has code that automatically
handles the uploading of multipart requests (MultiPartRequestWrapper et al).
This puts it into a folder specified in your cocoon.xconf file.  The action
subsequently picks up the FilePart object from the request and renames it to
the folder specified in the above upload-dir param.

Hope this helps.


 -----Original Message-----
From: 	Chitharanjan Das []
Sent:	16 April 2002 22:00
Subject:	RE: File Upload using action or any other approach

Hello Andre,
	Thanks for the input....

I do not need to process the Data ..

Let me re-iterate the problem..

User is presented with a HTML form to upload a data file (XML or not).

The user then browses for the file on his m/c (client) and presses the
submit button..

Now this file has to be uploaded into a specific directory on the

My question is , Does cocoon have inbuilt functionalities to handle
Multipart requests or should I code it. At this moment I am not
considering in processing the contents of the file.

Could U please illustrate your approach (with code snippet, if possible)
, how to achieve just the transfer of file from client to a specific
directory on the server.


Do You Yahoo!?
Get your free address at

Please check that your question has not already been answered in the
FAQ before posting. <>

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

View raw message