Definitely a plus - hardcoding is evil ;-)
 
---
Billy Cravens
----- Original Message -----
Sent: Tuesday, December 18, 2001 10:02 AM
Subject: RE: RE:

This has little to do with this conversation, but I just want to point out the expandPath() function to any of you who haven�t used it.  It�s CF�s equivalent to ASP�s Server.MapPath().

You supply a relative path as the argument, it returns the full path.

It makes your app much more portable to other servers (you don�t have to worry about changing any absolute path references, etc)

 

expandPath(�.�) will return the entire directory path of the current directory (like �D:\web\blah\blah\blah\thisDir\�)

 

 

The code in PK�s message could have been written like so:

 <cffile action="UPLOAD"
          filefield="Image"
          destination="#expandPath(�images�)#"
          nameconflict="OVERWRITE">

 

take it easy

david

 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of BILLY CRAVENS
Sent:
Tuesday, December 18, 2001 9:36 AM
To: [EMAIL PROTECTED]
Subject: Re: RE:

 

I'll reiterate what Robert said.  When you're having problems with the file upload tag, this is the problem 99% of the time.

 

---
Billy Cravens

----- Original Message -----

Sent: Monday, December 17, 2001 12:28 PM

Subject: RE:

 

ensure that the form tag also contains this attribute.

 

enctype="multipart/form-data"

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 17, 2001 12:26 PM
To: [EMAIL PROTECTED]
Subject:

I keep getting the following error when I send this code:

 

<cfif #Form.Image# IS "">
  <!--- Take no action --->
<cfelse>
 <cffile action="UPLOAD"
          filefield="Image"
          destination="D:\html\users\cfxa926\bbeaorg\html\Images\"
          nameconflict="OVERWRITE">
 <CFQUERY NAME="AddImage" DATASOURCE="#datasource#">
    UPDATE     Items
    SET             Image='#cffile.ClientFile#'
    WHERE       ItemID = #Attributes.ItemID#
 </CFQUERY>
</cfif>

--------------------------

Error Diagnostic Information

Error in CFFILE tag

The form field specified in the CFFILE tag (IMAGE) does not contain an uploaded file. Please be sure that you have specified the correct form field name.

The error occurred while processing an element with a general identifier of (CFFILE), occupying document position (32:2) to (35:30).

-----------------------------------

I have never gotten this error before, and cannot seem to figure out what it means.  The field name IS #Image# and seems to work just fine everywhere else in the application.

thanks!

PK

Reply via email to