You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Madhavi Thottempudi <ma...@caret.cam.ac.uk> on 2004/05/26 16:47:20 UTC

uploading file in cocoon2.1.4

Hi there!

I am trying to upload a zip file and save it somewhere on the hard-drive.
I am using cocoon 2.1.4. Can anybody suggest me what is the best way to 
upload files in cocoon2.1.4 version.
I am doing as shown below and I am not able to pick up the file. Don't know 
where I am going wrong. Any suggestions or tips on this
matter would be of great help to me. Thanks in advance.

In xsl:
--------------------
<form action="upload" method="post" enctype="multipart/form-data">
         <input type="file" name="uploadedFile"/>
         <br/>
         <input name="submit" type="submit"/>
</form>


In sitemap:
--------------------------------
actions:
       <map:action name="fileupload" 
src="uk.ac.cam.caret.molstruc.cocoon.UploadPackage"/>

pipeline:
   <map:match pattern="upload">
         <map:act type="fileupload">
                 <map:parameter name="uploadedFile" 
value="{request-param:uploadedFile}"/>
                 <map:serialize type="xhtml"/>
         </map:act>
     </map:match>


My java class file:
--------------------------------
public class UploadPackage extends AbstractLogEnabled implements Action
{

public Map act(Redirector redirector,
    SourceResolver resolver,
    Map objectModel,
    String src,
    Parameters parameters) throws Exception {

Request request = ObjectModelHelper.getRequest(objectModel);

Part filePart = (PartOnDisk) request.get("uploadedFile");

if (filePart != null) {

getLogger().debug("Uploaded file name = " + filePart.getFileName());

} else {

getLogger().debug("File not found");

}

return java.util.Collections.EMPTY_MAP;

}

} 

Re: uploading file in cocoon2.1.4

Posted by go...@osmosis.gr.
one more link 

http://wiki.cocoondev.org/Wiki.jsp?page=RecipeUploadUsingAction


--stavros


On Thu, 27 May 2004, Madhavi Thottempudi wrote:

> Thank you Jeorg and Venkatesan for your suggestions.
> I will look into the documentation and hopefully I will find a solution.
> 
> - M
> 
> 
> Now
> At 22:52 26/05/2004, you wrote:
> >On 26.05.2004 16:47, Madhavi Thottempudi wrote:
> >
> >>Hi there!
> >>I am trying to upload a zip file and save it somewhere on the hard-drive.
> >>I am using cocoon 2.1.4. Can anybody suggest me what is the best way to 
> >>upload files in cocoon2.1.4 version.
> >>I am doing as shown below and I am not able to pick up the file. Don't 
> >>know where I am going wrong. Any suggestions or tips on this
> >>matter would be of great help to me. Thanks in advance.
> >
> >There is much documentation available about file upload on the wiki:
> >
> >http://wiki.cocoondev.org/Wiki.jsp?page=FileUploadWithAction
> >http://wiki.cocoondev.org/Wiki.jsp?page=FileUploadsInCustomActions
> >http://wiki.cocoondev.org/Wiki.jsp?page=FileUploadsWithCocoon
> >http://wiki.cocoondev.org/Wiki.jsp?page=FileUploadsWithCocoon2.1
> >http://wiki.cocoondev.org/Wiki.jsp?page=FileUploadsWithFlow
> >
> >Joerg
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> >For additional commands, e-mail: users-help@cocoon.apache.org
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 


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


Re: uploading file in cocoon2.1.4

Posted by Madhavi Thottempudi <ma...@caret.cam.ac.uk>.
Thank you Jeorg and Venkatesan for your suggestions.
I will look into the documentation and hopefully I will find a solution.

- M


Now
At 22:52 26/05/2004, you wrote:
>On 26.05.2004 16:47, Madhavi Thottempudi wrote:
>
>>Hi there!
>>I am trying to upload a zip file and save it somewhere on the hard-drive.
>>I am using cocoon 2.1.4. Can anybody suggest me what is the best way to 
>>upload files in cocoon2.1.4 version.
>>I am doing as shown below and I am not able to pick up the file. Don't 
>>know where I am going wrong. Any suggestions or tips on this
>>matter would be of great help to me. Thanks in advance.
>
>There is much documentation available about file upload on the wiki:
>
>http://wiki.cocoondev.org/Wiki.jsp?page=FileUploadWithAction
>http://wiki.cocoondev.org/Wiki.jsp?page=FileUploadsInCustomActions
>http://wiki.cocoondev.org/Wiki.jsp?page=FileUploadsWithCocoon
>http://wiki.cocoondev.org/Wiki.jsp?page=FileUploadsWithCocoon2.1
>http://wiki.cocoondev.org/Wiki.jsp?page=FileUploadsWithFlow
>
>Joerg
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>


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


Re: uploading file in cocoon2.1.4

Posted by Joerg Heinicke <jo...@gmx.de>.
On 26.05.2004 16:47, Madhavi Thottempudi wrote:

> Hi there!
> 
> I am trying to upload a zip file and save it somewhere on the hard-drive.
> I am using cocoon 2.1.4. Can anybody suggest me what is the best way to 
> upload files in cocoon2.1.4 version.
> I am doing as shown below and I am not able to pick up the file. Don't 
> know where I am going wrong. Any suggestions or tips on this
> matter would be of great help to me. Thanks in advance.

There is much documentation available about file upload on the wiki:

http://wiki.cocoondev.org/Wiki.jsp?page=FileUploadWithAction
http://wiki.cocoondev.org/Wiki.jsp?page=FileUploadsInCustomActions
http://wiki.cocoondev.org/Wiki.jsp?page=FileUploadsWithCocoon
http://wiki.cocoondev.org/Wiki.jsp?page=FileUploadsWithCocoon2.1
http://wiki.cocoondev.org/Wiki.jsp?page=FileUploadsWithFlow

Joerg

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