Return-Path: Delivered-To: apmail-cocoon-users-archive@www.apache.org Received: (qmail 25023 invoked from network); 1 Nov 2004 16:22:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 1 Nov 2004 16:22:02 -0000 Received: (qmail 22944 invoked by uid 500); 1 Nov 2004 16:21:21 -0000 Delivered-To: apmail-cocoon-users-archive@cocoon.apache.org Received: (qmail 22888 invoked by uid 500); 1 Nov 2004 16:21:21 -0000 Mailing-List: contact users-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: users@cocoon.apache.org Delivered-To: mailing list users@cocoon.apache.org Received: (qmail 22860 invoked by uid 99); 1 Nov 2004 16:21:21 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: local policy) Received: from [62.166.160.82] (HELO clockwork.nl) (62.166.160.82) by apache.org (qpsmtpd/0.28) with SMTP; Mon, 01 Nov 2004 08:21:20 -0800 Received: (qmail 14775 invoked by uid 537); 1 Nov 2004 16:47:02 -0000 Received: from gertjan@assies.nu by apache by uid 531 with qmail-scanner-1.20 (spamassassin: 2.60. Clear:RC:1(192.168.1.39):SA:0(1.0/5.0):. Processed in 1.666827 secs); 01 Nov 2004 16:47:02 -0000 X-Spam-Status: No, hits=1.0 required=5.0 Received: from osw-callisto.oranjekerk.clockwork.loc (192.168.1.39) by apache.oranjekerk.clockwork.loc with SMTP; 1 Nov 2004 16:47:00 -0000 Received: from [192.168.1.169] ([192.168.1.169]) by osw-callisto.oranjekerk.clockwork.loc with Microsoft SMTPSVC(6.0.3790.0); Mon, 1 Nov 2004 17:18:54 +0100 Message-ID: <418661EE.5090407@assies.nu> Date: Mon, 01 Nov 2004 17:18:54 +0100 From: Gertjan Assies User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 To: users@cocoon.apache.org Subject: Re: Uploaded file disappears on Tomcat restart References: <20041101160049.1132.qmail@web53304.mail.yahoo.com> In-Reply-To: <20041101160049.1132.qmail@web53304.mail.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 01 Nov 2004 16:18:54.0543 (UTC) FILETIME=[7B73C5F0:01C4C02E] X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Paul, I believe the location in the setting will be cleaned and only that location, if you move it with the code below, Cocoon/Tomcat _should_ be unaware of the new location. Perhaps it has to do with your deploy method, I believe when deploying using the manager webapp in Tomcat, it recreates the webapp every time you restart Tomcat somewhere under the work directory, but i'm not sure about the precise mechanism cheers, Gertjan Paul Joseph wrote: >Actually Gertjan, > >I can move it directly to any directory I choose by >changing the upload setting in the Cocoon conf. file. > >If I use the approach below and keep it in a directory >that is still under the Tomcat heirarchy, I presume it >will still be deleted - no? > >thx >Paul >--- Paul Joseph wrote: > > > >>Thank you very much Gertjan. Your solution is much >>simpler than what I was planning to do, and so I >>will >>use it instead of mine! >> >> >>--- Gertjan Assies wrote: >> >> >> >>>Hi, >>> >>>I use the following simple code to move uploaded >>>files >>>It's called from the action which handles the >>>submitted form >>>the _sName here is extracted from the submitted >>>field value which >>>contains the local path and the filename >>> >>>private boolean moveFile(String _sName) { >>> boolean bResult = false; >>> File aInFile = new File(TEMP_PATH + >>> >>> >>_sName); >> >> >>> if (aInFile.exists()) { >>> File aOutFile = new File(DEST_PATH + >>>_sName); >>> bResult = aInFile.renameTo(aOutFile); >>> } >>> return bResult; >>>} >>> >>>Leszek Gawron wrote: >>> >>> >>> >>>>Paul Joseph wrote: >>>> >>>> >>>> >>>>>Thank you Grzegorz. >>>>> >>>>>I would like to save it under the Tomcat >>>>>hierarchy....so that Tomcat can serve the >>>>> >>>>> >>>uploaded >>> >>> >>>>>file to other users in the company. >>>>> >>>>>That being the case, the other option that you >>>>> >>>>> >>>suggest >>> >>> >>>>>is to disable autoupload. >>>>> >>>>>If I do this, will the upload widget continue >>>>> >>>>> >>to >> >> >>>work? >>> >>> >>>>>(that is all I care about in terms of >>>>> >>>>> >>uploading) >> >> >>>>First I think there is no such thing as >>>> >>>> >>>autoupload. However if the >>> >>> >>>>upload is being enabled in web.xml file then if >>>> >>>> >>>multipart request >>> >>> >>>>comes the request is automatically properly >>>> >>>> >>>decoded and made available >>> >>> >>>>to the user. Query cocoon wiki for the way to >>>> >>>> >>>obtain the access to >>> >>> >>>>FilePart. You should copy the data into some >>>> >>>> >>>storage (filesystem, >>> >>> >>>>database). I do not really remember the details >>>> >>>> >>of >> >> >>>this mechanism. If >>> >>> >>>>it persists temporary data to disk it will be >>>> >>>> >>>deleted after the >>> >>> >>>>request has been processed. >>>> >>>> >>>> >>> >>> >>> >--------------------------------------------------------------------- > > >>>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 > > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org For additional commands, e-mail: users-help@cocoon.apache.org