<input type="hidden" name="DocumentRef"
value="">
<input type="file" id="txtDocument"
name="Document"
maxlength="255" value="" style="font-size: xx-small; width: 50%;">
function attachmentInit(pForm){
if(pForm.Document && pForm.DocumentRef){
pForm.DocumentRef.value = pForm.Document.value;
}
}
this makes sure you have the plain text value of the files name.
just plop this in a form, have attachmentInit called on the form submit like
<form onsubmit="attachmentInit(this);">
i typically call this at the end of my validation script so that it
doesn't happen until the form contents are validated.
hope this helps.
On Thu, 18 Nov 2004 14:38:57 -0500, Jeff Battershall
<[EMAIL PROTECTED]> wrote:
> Bill,
>
> That's a good one - how do you get the client side filename? That's
> something I never knew that I could obtain.
>
>
>
> Jeff
>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
> Of Bill Rawlinson
> Sent: Thursday, November 18, 2004 2:36 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [CFCDev] File Uploading via CFCs
>
> Jeff,
> We actually have a hidden and a visible form field on our form. When the
> file is chosen, we populate the hidden form field with the filename from the
> client machine using javascript.
>
> then when the form is processed we have both a document reference (the
> server side filename) and the document name (the client side filename)
>
> --
> Bill
> http://blog.rawlinson.us
> ----------------------------------------------------------
> You are subscribed to cfcdev. To unsubscribe, send an email
> to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev'
> in the message of the email.
>
> CFCDev is run by CFCZone (www.cfczone.org) and supported
> by Mindtool, Corporation (www.mindtool.com).
>
> An archive of the CFCDev list is available at
> [EMAIL PROTECTED]
>
> ----------------------------------------------------------
> You are subscribed to cfcdev. To unsubscribe, send an email
> to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev'
> in the message of the email.
>
> CFCDev is run by CFCZone (www.cfczone.org) and supported
> by Mindtool, Corporation (www.mindtool.com).
>
> An archive of the CFCDev list is available at
> [EMAIL PROTECTED]
>
--
Bill
http://blog.rawlinson.us
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev'
in the message of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).
An archive of the CFCDev list is available at
[EMAIL PROTECTED]