----- Original Message -----
From: "Dave Watts" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, July 20, 2004 2:16 PM
Subject: RE: CFFile upload problem

> > What I'm finding is that the form field contains a temp file name
> >
> > <cfif Len(form.premphoto)>
> >   <cfoutput>#form.premphoto#</coufput>
> >   <cffile ...>
> > </cfif>
> >
> > C:\WINNT\TEMP\ACFA4A2.tmp
> >
> > That file is nowhere to be found on the server, so I assume
> > either CF or IIS is cleaning up after it generates the page
> > sent back to the browser.
> >
> > Is that the expected behavior, to end up with a local file
> > name after the form submisssion, or is it behaving like this
> > because of the error?
>
> The form variable containing your uploaded file isn't a string; you
can't
> just check its length and output it. Until you run your CFFILE tag, it's
> just a pointer of sorts to the temporary file created by the server when
a
> file is uploaded. I suspect that your code might work if you just had
the
> CFFILE tag.

That was added afterwards in an attempt to debug the problem.  It fails in
the same manner without the <cfif> or <cfoutput>.  I will need something
to test within a <cfif> statement to know whether a file has been uploaded
or not so that I don't call the <cffile> statement when it's not needed.

I just noticed that I get the same CF error message if I use a
non-existant form field name.  Surprised CF doesn't give an undefined
variable error.

Error in CFFILE tag
The form field specified in the CFFILE tag (X) does not contain an
uploaded file. Please be sure that you have specified the correct form
field name.
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to