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

<cffile> when form field is hidden

Status
Not open for further replies.

DeZiner

Programmer
May 17, 2001
815
US
Hi all,

I have developed an application to generate emails for internal purposes. Part of the email requires reading a text file and pasting the contents into the email body.

Where the problem is:
We pull the text file from a specific directory on a network drive. I am trying to use <input type=&quot;hidden&quot; name=&quot;readfile&quot; value=&quot;&quot;> and Javascript generates the value for the file to read based on other form input. Well when reading &quot;readfile&quot; for the field to upload, CF is generating an error:
The form field specified in the CFFILE tag does not contain an uploaded file.

Am I right in thinking this is for security reasons so that the client HAS to be the one chosing the file?
Or is there another way about this?

DeZiner
Never be afraid to try something new.
Remember that amateurs built the Ark.
Professionals built the Titanic
 
The CFFILE tag can only be referring to a file on your server not on the client's machine.

I bet there is a problem with the JavaScript (Js in general is very particular).

Good Luck
 
<cffile action=&quot;upload&quot;
filefield=&quot;form.pempath&quot;
destination=&quot;E:\inetpub\ nameconflict=&quot;overwrite&quot;
>

The filefield only works when I use input type=file on the previous page. The javascript is correct because I have set the field to text even and an alert to verify the field is populated.

DeZiner
Never be afraid to try something new.
Remember that amateurs built the Ark.
Professionals built the Titanic
 
Why not use cffile action=&quot;read&quot; to get the contecnt of the file? its on a shared network drive mapped to the server right? then you can send the file contents through the hidden form to the email body.
or am i misunderstanding you?

 
The files reside on the network, which is seperate from our server. Rather than the user browsing the network drives for the file they want to upload, we are trying to grab the file from the network based on form input.

The problem is in the upload action. If the form page contains the file in a hidden field, no worky, if the file is in a &quot;file&quot; field, it all works. We want to avoid the user &quot;Browsing&quot; for the file and populate it form them.

DeZiner
Never be afraid to try something new.
Remember that amateurs built the Ark.
Professionals built the Titanic
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top