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:[EMAIL PROTECTED]]
Sent:   16 April 2002 22:00
To:     [EMAIL PROTECTED]; [EMAIL PROTECTED]
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: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to