Re: [Wyona] & Multipartrequest

Michael Wechner <[email protected]>
Newsgroups gmane.comp.cms.wyona.user
Message-ID <[email protected]>
You probably have to use the

org.apache.cocoon.util.PostInputStream

You can see how to use it by taking a look at

org.wyona.cms.cocoon.acting.XopusHandlerAction

It would be nice to have a file upload for Wyona.
Thanks for your help in advance

Michael


P.S.: Please use the new mailing lists at
http://mail.wyona.org/cgi-bin/mailman/listinfo



Rene Niedermowe wrote:

Hi Wyona Members

I have some Problems to implement a File upload within the CMS.


public Map act(Redirector redirector,SourceResolver resolver,Map 
objectModel,String src,Parameters parameters throws Exception
{
     org.apache.cocoon.environment.Source input_source=resolver.resolve("");
     String sitemapParentPath=input_source.getSystemId();
     sitemapParentPath=sitemapParentPath.substring(5); // Remove "file:" 
protocoll
     getLogger().debug("PARENT PATH OF SITEMAP: "+sitemapParentPath);

     // Get request object
     Request request=(Request)objectModel.get(Constants.REQUEST_OBJECT);
     if(request == null)
     {
       getLogger().error ("No request object");
       return null;
     }


     // cast a HttpRequest to get an getInputStream()
     HttpRequest req = (HttpRequest) 
objectModel.get(Constants.REQUEST_OBJECT);


to save the file from the form (<form name="upload" action="upload" 
method="post" ENCTYPE="multipart/form-data">),
i need a InputStream, but the org.apache.cocoon.environment.Request 
doesn´t have one, so i cast
the request to a HttpRequest, but the InputStream is null (of cause).

Has anyone a Idea how to get the InputStream and save the file from the 
multipart/form-data ??


Greetings

Rene








To unsubscribe from this group, send an email to:
[email protected]



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.