Uh, please do not take offense, but this *looks* like custom
java code...
just to do what supposedly is supported in the framework -
upload a simple file
to a specified location.


-----Original Message-----
From: news [mailto:[EMAIL PROTECTED] Behalf Of Jorg
Heymans
Sent: Tuesday, January 13, 2004 12:41 AM
To: [EMAIL PROTECTED]
Subject: Re: Action to move/copy file from temporary upload
directory.


you don't need to store it in the temporary upload directory
first.
You can get an inputstream on the filepartarray in the
action.

Enumeration enum = request.getParameterNames();

   while (enum.hasMoreElements()) {
     String parameterName = (String)enum.nextElement();
     Object imageParamValue = request.get(parameterName);

     //is it an attached file
     if (imageParamValue instanceof FilePart) {
     FilePartArray fpa =
(FilePartArray)request.get(parameterName);

     ByteArrayInputStream bais =

(ByteArrayInputStream)fpa.getInputStream();
     .........

depub2 wrote:
> I am trying to use the upload feature in Cocoon. I
> understand the default upload mechanism which uploads to a
> temporary directory and requires the file to be copied or
> moved before the request ends. I can get a file to upload
to
> the temporary directory.
>
> THE QUESTION IS: How do I move/copy the file without
> dropping into some custom java code or xsp? Isn't there a
> cocoon action like "copy-file"? Do I really have to drop
all
> the way down to custom java/xsp to do something simple
like
> move a file?
>
> Thanks so much!!
>
> David


------------------------------------------------------------
---------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to