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!

cffile action="read"

Status
Not open for further replies.

Rachel80

Programmer
May 25, 2000
63
GB
my data is stored in mssql server. <br>the data type, varchar, only allow me to input 255 characters so i use &lt;cffile action=&quot;write&quot;&gt; to write input into text file. <br>Then store the pathname in database. <br>To retrieve the file contents, i use &lt;cffile action=&quot;read&quot;&gt; but i cannot output the contents of the file, instead got its pathname... <br>so how can i save my input as??? <br>pls help, thank you
 
If you're using CFFILE ACTION=&quot;write&quot; like this:<br><FONT FACE=monospace>&lt;CFFILE ACTION=&quot;Write&quot; FILE=&quot;c:\myfiles\thefile.txt&quot; OUTPUT=&quot;#form.content#&quot;&gt;</font><br><br>You should be able to read it with:<br><br><FONT FACE=monospace>&lt;CFFILE ACTION=&quot;Read&quot; FILE=&quot;c:\myfiles\thefile.txt&quot; VARIABLE=&quot;Message&quot;&gt;<br>&lt;CFOUTPUT&gt;#Message#&lt;/CFOUTPUT&gt;</font><br><br>Make sure you are using the full path name in both the write and read actions, and the correct file name, and you should be able to read it....<br><br>Let me know if this helps...<br><br>DM<br><br>
 
sorry i guess u got the wrong idea...<br>the problem with my program is: the pathname of text file is stored in database, so i guess there's no use storing the contents in a variable. Next time when i retrieve data from the database, i want to retreive the contents and read the text file. Instead, only pathname is displayed.
 
hm... i got it!<br>bcoz i thought that the variable for cfile action=&quot;write&quot; must be the same as the one in action=&quot;read&quot;, which is not very possible... so i thought i can't use this method. but it works already, thanx alot!<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top