Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

BROWSE BUTTON IN CF

Status
Not open for further replies.

alexfusion

Programmer
Feb 5, 2001
94
AR
Hi everyone!
I would like to know how I can put a BROWSE button so the visitor can add an attachmment from a form.
Second question:
What is the way to delete a record from a datadase using a CF tag? Do I have to use the SQL statement or there is an specific CF tag for doing this?

Thank you so much!

Alejandro

mixale@hotmail.com
 
<input type=&quot;file&quot; name=&quot;Attachment&quot;>
(make sure in form tag ... enctype=&quot;multipart/form-data&quot;)

<cfquery datasource=&quot;[datasource]&quot;>
delete from [TableName]
where [criteria]
</cfquery>

HTH,
Marc
 
Hi alexfusion,

1. FORM
-------------------------------
The code for the form is:

<FORM ACTION=&quot;&quot; ENCTYPE=&quot;multipart/form-data&quot;>
<INPUT TYPE=&quot;file&quot; &quot; NAME=&quot;picture&quot; SIZE=&quot;20&quot;>
</FORM>

MAKE SURE you include &quot;ENCTYPE=&quot;multipart/form-data&quot; because otherwise the file will NOT be sent!


On the next page you can 'upload' the file to a specified folder on your system like:

<CFFILE ACTION=&quot;UPLOAD&quot; FILEFIELD=&quot;picture&quot; DESTINATION=&quot;d:\inetpub\ NAMECONFLICT=&quot;OVERWRITE&quot;>

2. Delete
------------------------
<CFQUERY NAME=&quot;Delete_a_record&quot;
DATASOURCE=&quot;news&quot;>
DELETE * FROM articles
WHERE articleID = #URL.articleID#
</CFQUERY>


On the previous page you output a list with all the articles and you link to:

e.g.: delete.cfm?articleID=15


I hope this has helped you
bram
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top