You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Mohit Narain <m....@solitarsystems.com> on 2001/09/11 11:48:51 UTC

Uploads

How does one configure where exactly the uploaded files are stored? In the
xsp file, we have:

public void contextualize(Context context) throws ContextException {
	uploadDir = (File) context.get(Constants.CONTEXT_UPLOAD_DIR);
}

I tried to change this as follows: uploadDir = (File) "c:\"; However, the
page did not display. Any idea where/how we should configure this?

Also, when the upload completes, by default, the "upload" page reloads.
However, if the upload code is in some file of ours (say try.xsp), then
where do we configure it to reload this page after the upload is complete?

Looking forward to your response,
Best Wishes...Mohit


---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Uploads

Posted by Chris Newland <ch...@emorphia.com>.
Hi Mohit,

Look in WEB-INF/web.xml:

    <!--
      This parameter allows to specify where Cocoon should put files
      which are uploaded by the upload.xsp sample. The path specified
      is always relative to the context path of the servlet.
      The default directory is "image-dir" in the work-directory
    -->
 
    <init-param>
      <param-name>upload-directory</param-name>
     <param-value>upload_location_relative_to_cocoon_webapp_dir</param-value>
    </init-param>


Hope this helps,

Regards,

Chris


On Tuesday 11 September 2001 09:48, you wrote:
> How does one configure where exactly the uploaded files are stored? In the
> xsp file, we have:
>
> public void contextualize(Context context) throws ContextException {
> 	uploadDir = (File) context.get(Constants.CONTEXT_UPLOAD_DIR);
> }
>
> I tried to change this as follows: uploadDir = (File) "c:\"; However, the
> page did not display. Any idea where/how we should configure this?
>
> Also, when the upload completes, by default, the "upload" page reloads.
> However, if the upload code is in some file of ours (say try.xsp), then
> where do we configure it to reload this page after the upload is complete?
>
> Looking forward to your response,
> Best Wishes...Mohit
>
>
> ---------------------------------------------------------------------
> 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: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>


---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


AW: Uploads

Posted by Jörn Heid <he...@fh-heilbronn.de>.
You can't cast a string to a file (I think you have to learn more about
Java, first)!
Try
uploadDir = new File ("c:\\"); // look for the '\\'!

instead. I think you forced a compiler error.

The other question:
You want to reload a page, right?
There are many possibilities. The probably easiest version is to use
JavaScript to redirect to another page.
Actions might help you, too.

Feel free to contact me if you need additional help.

-----Ursprüngliche Nachricht-----
Von: Mohit Narain [mailto:m.narain@solitarsystems.com]
Gesendet: Dienstag, 11. September 2001 11:49
An: Cocoon Users
Betreff: Uploads


How does one configure where exactly the uploaded files are stored? In the
xsp file, we have:

public void contextualize(Context context) throws ContextException {
	uploadDir = (File) context.get(Constants.CONTEXT_UPLOAD_DIR);
}

I tried to change this as follows: uploadDir = (File) "c:\"; However, the
page did not display. Any idea where/how we should configure this?

Also, when the upload completes, by default, the "upload" page reloads.
However, if the upload code is in some file of ours (say try.xsp), then
where do we configure it to reload this page after the upload is complete?

Looking forward to your response,
Best Wishes...Mohit


---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Uploads

Posted by giacomo <gi...@apache.org>.
On Tue, 11 Sep 2001, Mohit Narain wrote:

> How does one configure where exactly the uploaded files are stored? In the
> xsp file, we have:

There is a upload-directory parameter in the web.xml file which points
to it.

Giacomo

>
> public void contextualize(Context context) throws ContextException {
> 	uploadDir = (File) context.get(Constants.CONTEXT_UPLOAD_DIR);
> }
>
> I tried to change this as follows: uploadDir = (File) "c:\"; However, the
> page did not display. Any idea where/how we should configure this?
>
> Also, when the upload completes, by default, the "upload" page reloads.
> However, if the upload code is in some file of ours (say try.xsp), then
> where do we configure it to reload this page after the upload is complete?
>
> Looking forward to your response,
> Best Wishes...Mohit
>
>
> ---------------------------------------------------------------------
> 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: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
>
>
>
>


---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>