0

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"

rrk
  • 15,677
  • 4
  • 29
  • 45
Merle_the_Pearl
  • 1,391
  • 3
  • 18
  • 25
  • Your code should write the file in the directory where your cf template is present. Is the path of the cfm also on the webroot? – rrk Nov 02 '20 at 20:00
  • Please consider deleting the question if the answer does not serve any real purpose. – rrk Nov 02 '20 at 20:31
  • Not directly related to the question, but passwords should not be stored in plain text – SOS Nov 07 '20 at 17:18

1 Answers1

0

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?

Merle_the_Pearl
  • 1,391
  • 3
  • 18
  • 25