Gday hope you can help, think its an easy one!!!!
uploading a image, at the min i get a fault from my action.cfm because there
was no image selected in the upload box, is there a way not require this field?
i need my form to upload but if there is no image there thats ok
hope you understand...

upload file not required

Gday hope you can help, think its an easy one!!!!

uploading a image, at the min i get a fault from my action.cfm because there
was no image selected in the upload box, is there a way not require this field?
i need my form to upload but if there is no image there thats ok

<!--- get name of file that was saved to the server, may be different from
what
users uploaded file was (image1.jpg) as there may have already been a file
with this name on the server so it had to rename it etc
if file upload was not successful this will probably be empty so may need to
add some checking --->
<CFSET myFileName = cffile.serverfile>

<!--- this will output image1.jpg assuming the image name was not changed when
uploaded
otherwise it might be something like ACF1CA.jpg or some other auto generated
name --->
<CFOUTPUT>Name of file uploaded to server: #myFileName#</CFOUTPUT>

<!--- if you want to save this filename in the database --->
<CFQUERY ...>
UPDATE FileTable
SET FileName = '#myFileName#'
</CFQUERY>

Re: upload file not required

You're not adding the actual file into the database, you are adding the name of
the file only. eg. image1.jpg. The file is saved on the server, you are just
adding a reference for the filename to the database so you know which file on
the server that database entry links to.

So you're actaully just adding a text string to the database.

so when you retrieve the data later you will need to know what directory it
was stored in so you can use the IMG tag to display the image
<IMG SRC="http:// <location of file> / #DatabaseQuery.FileNameField#">

Your code is alright except your INSERT INTO line has one field name specified
in the brackets but your VALEUS line has 2 values : 1 and myFieldName. Cannot
insert 2 values into one column/field in the database.