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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

uploading files

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I need for viewers to be able to browse their computer for a particular file and upload it to my server. How? I would really appreciate anyone's help. If there is a site with a good tutorial on this just direct me there. Thanks in advance.
 
UPLOAD_FORM.CFM --- This will upload the user selected file to a file named test.txt.<br>
&lt;CFSET filename=&quot;test.txt&quot;&gt;<br>
&lt;CFSET rid=&quot;11&quot;&gt;<br>
&lt;CFSET DSOURCE = &quot;xxx&quot;&gt;<br>
<br>
&lt;CFOUTPUT&gt;<br>
<br>
&lt;FORM ACTION=&quot;upload.cfm?rid=#rid#&DS=#DSOURCE#&quot; ENCTYPE=&quot;multipart/form-data&quot; METHOD=&quot;post&quot;&gt;<br>
&lt;TABLE BORDER=&quot;0&quot;&gt;<br>
&lt;TR&gt;&lt;TD WIDTH=&quot;70&quot;&gt; &lt;/TD&gt;<br>
&lt;TR&gt;&lt;TD WIDTH=&quot;530&quot;&gt;Filename: #filename#&lt;INPUT TYPE=hidden NAME=filename VALUE=#filename#&gt;&lt;/TD&gt;&lt;/TR&gt;<br>
&lt;TR&gt;&lt;TD WIDTH=&quot;70&quot;&gt; &lt;/TD&gt;<br>
&lt;TR&gt;&lt;TD WIDTH=&quot;530&quot;&gt;&lt;INPUT TYPE=&quot;file&quot; NAME=&quot;contents&quot;&gt;&lt;/TD&gt;&lt;/TR&gt;<br>
&lt;TR&gt;&lt;TD WIDTH=&quot;70&quot;&gt; &lt;/TD&gt;<br>
&lt;TR&gt;&lt;TD WIDTH=&quot;530&quot;&gt;&lt;INPUT TYPE=&quot;submit&quot; NAME=&quot;submit&quot; VALUE=&quot;Upload File&quot;&gt;&lt;/TD&gt;&lt;/TR&gt;<br>
&lt;/TABLE&gt;<br>
&lt;/FORM&gt;<br>
<br>
&lt;/CFOUTPUT&gt;<br>
<br>
UPLOAD.CFM ---- CALLED BY UPLOAD_FORM.CFM<br>
&lt;CFSET rid=#URL.RID#&gt;<br>
&lt;CFSET DSOURCE = #URL.DS#&gt;<br>
<br>
&lt;CFSET filename=#Form.filename#&gt;<br>
&lt;CFSET destination=&quot;e:\<br>
<br>
&lt;CFFILE ACTION=&quot;upload&quot;<br>
FILEFIELD=&quot;Form.contents&quot;<br>
DESTINATION=&quot;#destination#&quot;<br>
NAMECONFLICT=makeunique&gt;<br>
<br>
<br>
&lt;html&gt;<br>
&lt;head&gt;<br>
&lt;/head&gt;<br>
&lt;body&gt;<br>
&lt;BR&gt;&lt;BR&gt;<br>
&lt;CENTER&gt;Please wait...&lt;/CENTER&gt;<br>
&lt;/body&gt;<br>
&lt;/html&gt;<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top