ColdFusion Write File

184 Views Asked by At

I'm reading a simple file of logset.txt which only contains Login:,Pass:

File is stored on webroot.

Reading it, and if no data after :. I want user to set their login data and store it.

So they would enter on a form their login and password. So enter Bob and Turkey

And then I want it to Overwrite the logset.txt file as: Login:Bob,Pass:Turkey

I am trying this with no luck.

<cfset nf = "Login:Bob,Pass:Turkey">

<CFFILE ACTION="Write"
    FILE="logset.txt"
    nameConflict="overwrite"
    OUTPUT="#nf#">

Is this a path issue? I have tried "/logset.txt" and "\logset.txt"

1

There are 1 best solutions below

2
Merle_the_Pearl On

Ignore. Path Problem This works.

   <cfset fpath = expandpath('\')>

   <CFFILE ACTION="Write"
     FILE="#FPath#logset.txt"
     nameConflict="overwrite"
     OUTPUT="#nf#">

Now anyone got an idea of how to write to a mobile device local?