Return-Path: Delivered-To: apmail-cocoon-users-archive@www.apache.org Received: (qmail 68569 invoked from network); 17 Mar 2008 14:27:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Mar 2008 14:27:12 -0000 Received: (qmail 83269 invoked by uid 500); 17 Mar 2008 14:27:07 -0000 Delivered-To: apmail-cocoon-users-archive@cocoon.apache.org Received: (qmail 83240 invoked by uid 500); 17 Mar 2008 14:27:07 -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 List-Id: Delivered-To: mailing list users@cocoon.apache.org Received: (qmail 83229 invoked by uid 99); 17 Mar 2008 14:27:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Mar 2008 07:27:07 -0700 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [195.216.81.147] (HELO mail.otego.com) (195.216.81.147) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Mar 2008 14:26:29 +0000 Received: (qmail 755 invoked from network); 17 Mar 2008 14:26:38 -0000 Received: from 192.168.222.135 by zeus (envelope-from , uid 201) with qmail-scanner-1.25st (clamdscan: 0.91.2/4015. perlscan: 1.25st. Clear:RC:1(192.168.222.135):. Processed in 0.026166 secs); 17 Mar 2008 14:26:38 -0000 Received: from unknown (HELO ?192.168.222.135?) (192.168.222.135) by 0 with SMTP; 17 Mar 2008 14:26:38 -0000 Message-ID: <47DE7F9E.7040800@apache.org> Date: Mon, 17 Mar 2008 15:26:38 +0100 From: Felix Knecht User-Agent: Thunderbird 2.0.0.12 (X11/20080229) MIME-Version: 1.0 To: users@cocoon.apache.org Subject: Re: upload widget References: <47DBD422.1020500@didm.co.uk> <47DDAC36.1010704@tuffmail.com> <47DE3C29.40604@didm.co.uk> In-Reply-To: <47DE3C29.40604@didm.co.uk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Peter Sparkes schrieb: > Thanks Grzegorz, > > Unfortunately I can't get it to work, code is: > > function upload() { > var form = new Form("forms/upload_model.xml"); > var k = form.showForm("upload-display-pipeline.jx"); > > k.invalidate(); > > var widget = form.getChild("upload"); > var uploadedContent = handleUpload(form); > var part = widget.getValue(); > part.copyToFile("new.pdf") ; I don't think that 'part' implements a the function 'copyToFile' (at least I haven't found it). I get the file path of the uploaded file by var filePath = widget.getValue().getFile(); Then you can copy it via custom copy functions to where you want. I disabled the "k.invalidate()" and keep the file also after the request "upload.getValue( ).setDisposeWithRequest( false );" is gone (file is by default disposed with the request) because I copy it not within the request - but I must take care mayself after copying the the file gets deleted. var uploadWidget = form.lookupWidget( "upload" ); var k = form.showForm( screen ); // k.invalidate(); // do not allow return to the form if( upload.value != null ) { var filePath = upload.value.file; upload.getValue( ).setDisposeWithRequest( false ); } HTH Felix --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org For additional commands, e-mail: users-help@cocoon.apache.org