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!

ColdFusion CFFILE and perl script

Status
Not open for further replies.

jamaica

Technical User
May 10, 2001
1
US
I'm not familiar with ColdFusion and just learning, so please bear with me.

I have a form, which points to a perl script on a unix box.

The form has an <input type=&quot;file&quot;> field. I'm told that the only way to get this field to work is unless I have the web page on a ColdFusion server box ... I have space on a coldfusion server, so I'm doing some test.

Anyway, I did a simple form to see if I will be able to more than just click on the BROWSE button, select my file. I want the file to be upload somewhere but I keep getting this error about ----- &quot;The form field specified in the CFFILE tag (DITTO) 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 (17:1) to (17:132) in the template file &quot;

I decided to add a @referer line in the perl script to the ColdFusion server, but after doing that I got an Internal Server Error.

Can someone please let me know what I'm doing and give me an easier way to go about this?

<html>
<body>
<FORM METHOD=post enctype=&quot;multipart/form-data&quot; ACTION=&quot;<input type=&quot;file&quot; name=&quot;ditto&quot;>

<INPUT TYPE=SUBMIT NAME=SUBMIT>

<input type=&quot;hidden&quot; name=&quot;recipient&quot; value=&quot;me@work.com&quot;>
<input type=&quot;hidden&quot; name=&quot;required&quot; value=&quot;recipient&quot;>
&quot;&quot;>
<cffile action=&quot;UPLOAD&quot; filefield=&quot;ditto&quot; destination=&quot;/usr/local/opt/datagate/html/services/&quot; nameconflict=&quot;MAKEUNIQUE&quot; mode=&quot;755&quot;>

</form>
</body>
</html>
 
Hey Jamaica,

You need to put the <cffile> tag in the script which the form calls. If you change this line

ACTION=&quot;
to

ACTION=&quot;
and then put

<cffile action=&quot;UPLOAD&quot; filefield=&quot;ditto&quot;
destination=&quot;/usr/local/opt/datagate/html/services/&quot;
nameconflict=&quot;MAKEUNIQUE&quot; mode=&quot;755&quot;>

in the file test.cfm, I think it will work for you (test.cfm must be on your CF server).

Right now, you have the <cffile> in the main script and there's nothing for it to upload since nothing has been sent to the server when it runs. The <form>'s action attribute tells the browser where to send the form information as well as the file which is being uploaded. When you tell it to send it to a .cfm script, the file being uploaded is then available to the .cfm script and <cffile> will be able to process it.

Hope this helps,
GJ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top