QUOTE(loki421 @ 5 Jul, 2008 - 12:52 AM)

I have an image upload button that users can use to browse their hard drive, but when I click submit, the image file doesn't upload to the db, everything else does.
To insert the image into your database you will need to:
1) Upload the image(s) with the <cffile> tag
before your insert query
http://livedocs.adobe.com/coldfusion/7/htm...253.htm#35400912) Read the binary content of the image(s) into a variable using <cffile action="readBinary"..>
http://livedocs.adobe.com/coldfusion/7/htm...251.htm#35453063) Add the variable and image(s) column to your insert query
QUOTE(loki421 @ 5 Jul, 2008 - 12:52 AM)

I don't think naming the images will be practical as there will be several users on the data entry form/admin site at anyone time, so trying to co-ordinate image numbering would be a logistical nightmare!!
That's not really a problem. You can use CFFILE's nameConflict="makeUnique". So if the file name already exists, CF will automatically generate a unique name. Storing the file name/path is usually a better option than storing the image as a blob in the database. One reason is that blob's can bloat your database very quickly.
QUOTE
<td>Image</td>
<td><input name="userfile[]" type="file" /></td>
...
<td>Brochure</td>
<td><label>
<input name="userfile[]" type="file" />
Totally unrelated here but
1. Both of your "file" fields have the same name. There are cases where you _do_ want to give form fields the same name. But in this case.. it is probably better to give them different names. To avoid potential problems.
2. Your "file" field names contain some funky characters: "[]". It is probably allowed, but because of that you may be forced to use array notation to access the value.
For that reason I personally tend to stick with the old conventions for form field names:
- Form field name should start with an alpha character
- Should consist only of of letters, numbers and underscores "_"