cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeremy Aston" <jeremyas...@yahoo.co.uk>
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 -
http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=101878098524370&w=2 .  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 />
		</map:act>

</map:act>
</map:match>

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.

Jez

 -----Original Message-----
From: 	Chitharanjan Das [mailto:cdas@accordiasys.com]
Sent:	16 April 2002 22:00
To:	cocoon-users@xml.apache.org; Andre.Juffer@oulu.fi
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
server.


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.

Regds,
Chiths













_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

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


Mime
View raw message