House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

ColdFusion newbie trying to write to a txt file

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Hi,
Kurt Dommermuth
04/28/04 09:18 A
you may need to use the full path like
Tony Weeg
04/28/04 09:23 A
Kurt Dommermuth wrote:
Stephen Moretti
04/28/04 09:27 A
At 09:37 AM 4/28/2004 -0400, you wrote:
Kurt Dommermuth
04/28/04 09:43 A
possiblemente...
Tony Weeg
04/28/04 09:45 A
Tony Weeg wrote:
Stephen Moretti
04/28/04 10:02 A
Hi Stephen,
Kurt Dommermuth
04/28/04 10:13 A
Hi Adam,
Kurt Dommermuth
04/28/04 09:34 A
Kurt,
Adrocknaphobia
04/28/04 11:15 A
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Kurt Dommermuth
04/28/2004 09:18 AM

Hi, I was hoping someone could help.  I am trying to do something and have tried a ton of variations, but have had no luck. why won't this write to a text file? <cffile action = "write" file = "write_greeting.cfm" output = "test"> thanks for any help, Kurt Kurt Dommermuth Head Woodsman: http://www.punch-me.com Something fun for the itty bitty ones: http://www.kneebouncers.com

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Tony Weeg
04/28/2004 09:23 AM

you may need to use the full path like c:\inetpub\wwwroot or it will likely throw the newly created file into some system directory or root path of something. are you getting errors? or are you just not getting the file in the place you are expecting? tony Hi, I was hoping someone could help.  I am trying to do something and have tried a ton of variations, but have had no luck. why won't this write to a text file? <cffile action = "write" file = "write_greeting.cfm" output = "test"> thanks for any help, Kurt Kurt Dommermuth Head Woodsman: http://www.punch-me.com Something fun for the itty bitty ones: http://www.kneebouncers.com

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Stephen Moretti
04/28/2004 09:27 AM

Kurt Dommermuth wrote: ----- Excess quoted text cut - see Original Post for more ----- It should write the file write_greeting.cfm into the current template folder with the content "test". Whats the error message you are getting? What are you actually trying to do by writing a cfm file? Stephen CFMX Hosting ::Macromedia ColdfusionMX hosting, with support for FlashMX, Flash Remoting, DreamweaverMX:: www.CFMXHosting.co.uk

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Kurt Dommermuth
04/28/2004 09:37 AM

Adam, had also asked if I was getting errors and I forgot to say that I wasn't. Tony, I used <cfoutput>#GetBaseTemplatePath()#</cfoutput> to determine where exactly I was in the directory structure and used this information as an absolute path.  still no luck. this is what it looked like when I tried that. <cffile action = "write" file = "D:\http\centurycouncil_org\kurt_test\write_greeting.cfm" output = "test"> thank you, Kurt At 09:20 AM 4/28/2004 -0400, you wrote: ----- Excess quoted text cut - see Original Post for more ----- Kurt Dommermuth Head Woodsman: http://www.punch-me.com Something fun for the itty bitty ones: http://www.kneebouncers.com

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Tony Weeg
04/28/2004 09:39 AM

is this a shared hosting environment?  is cffile allowed? tony Adam, had also asked if I was getting errors and I forgot to say that I wasn't. Tony, I used <cfoutput>#GetBaseTemplatePath()#</cfoutput> to determine where exactly I was in the directory structure and used this information as an absolute path.  still no luck. this is what it looked like when I tried that. <cffile action = "write" file = "D:\http\centurycouncil_org\kurt_test\write_greeting.cfm" output = "test"> thank you, Kurt At 09:20 AM 4/28/2004 -0400, you wrote: >you may need to use the full path like > >c:\inetpub\wwwroot> >or it will likely throw the newly created file into some system directory or ----- Excess quoted text cut - see Original Post for more ----- tried ----- Excess quoted text cut - see Original Post for more ----- Fast >Unsubscribe] [<http://www.houseoffusion.com/signin/>User Settings] > >---------- Kurt Dommermuth Head Woodsman: http://www.punch-me.com Something fun for the itty bitty ones: http://www.kneebouncers.com

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Kurt Dommermuth
04/28/2004 09:43 AM

At 09:37 AM 4/28/2004 -0400, you wrote: >is this a shared hosting environment?  is cffile allowed? > >tony hmmmmmm.  good question. I suppose I have to contact the admin to find out? ----- Excess quoted text cut - see Original Post for more ----- Kurt Dommermuth Head Woodsman: http://www.punch-me.com Something fun for the itty bitty ones: http://www.kneebouncers.com

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Tony Weeg
04/28/2004 09:45 AM

possiblemente... At 09:37 AM 4/28/2004 -0400, you wrote: >is this a shared hosting environment?  is cffile allowed? > >tony hmmmmmm.  good question. I suppose I have to contact the admin to find out? ----- Excess quoted text cut - see Original Post for more ----- Kurt Dommermuth Head Woodsman: http://www.punch-me.com Something fun for the itty bitty ones: http://www.kneebouncers.com

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Stephen Moretti
04/28/2004 10:02 AM

Tony Weeg wrote: ----- Excess quoted text cut - see Original Post for more ----- I would have expected a permission denied error if this was the case. Are you sure that the file isn't being written?  It might be a problem with flash reading the file rather than the file not being created. Incidently, you do realise that every user will see the same message?   If this is what you're after, then an easier way would just be to set a CF variable to the message (URLEncodedFormat)  and pass it directly into the flash using object/embed parameters.  No file writing involved - much more efficient. Stephen CFMX Hosting ::Macromedia ColdfusionMX hosting, with support for FlashMX, Flash Remoting, DreamweaverMX:: www.CFMXHosting.co.uk

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Kurt Dommermuth
04/28/2004 10:13 AM

Hi Stephen, >I would have expected a permission denied error if this was the case. no. I didn't get any permission denied errors. >Are you sure that the file isn't being written? yes. >  It might be a problem >with flash reading the file rather than the file not being created. No.  this works well and I understand why you'd mention it, but I'm pretty experienced with flash. >Incidently, you do realise that every user will see the same message? >If this is what you're after, then an easier way would just be to set a >CF variable to the message (URLEncodedFormat)  and pass it directly into >the flash using object/embed parameters.  No file writing involved - >much more efficient. The message is for the client to write to the user.  It is meant to be seen by everyone, but it is also something that she can update as needed without having to deal with any internet innards....  just a flash interface. Thank you! Kurt ----- Excess quoted text cut - see Original Post for more ----- Kurt Dommermuth Head Woodsman: http://www.punch-me.com Something fun for the itty bitty ones: http://www.kneebouncers.com

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Adrocknaphobia
04/28/2004 09:21 AM

Could you show us the full code, and exactly what isn't working about it. Are you getting unplanned results or is cf throwing an error? Why are you trying to create a cfm? -adam ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Kurt Dommermuth
04/28/2004 09:34 AM

Hi Adam, The only code in my (write_greeting.cfm) test file is this... <cffile action = "write" file = "ccText.txt" output = "test"> (apologies, i put the wrong parameter in 'file' in my last email.) I have a little flash movie that loads in dynamic text from the file ccText.txt. I also have a little flash interface so my client can: - enter a greeting and change the contents of ccText.txt. I am using CF because it's just whats installed on this particular server (normally I'd use PHP!). Hope I'm clear!? thansk again At 01:19 PM 4/28/2004 +0000, you wrote: ----- Excess quoted text cut - see Original Post for more ----- Kurt Dommermuth Head Woodsman: http://www.punch-me.com Something fun for the itty bitty ones: http://www.kneebouncers.com

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Adrocknaphobia
04/28/2004 10:52 AM

If cffile was sandboxed, cf would blow with an error saying so. -adam ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Kurt Dommermuth
04/28/2004 11:06 AM

Just a follow-up.  the guy who normally does CF gave me this as a solution. <cfset the_path = ExpandPath("*.*")> <cfset this_directory = GetDirectoryFromPath(the_path)> <cffile action="write" file="#this_directory#\ccText.txt" output="centurycouncilmessage=test"> this works. but now, what I really want to do, and this is probably OT, but I hope you don't mind me asking anyway, is pass a variable called 'content' from flash to the above script with the exception that output="centurycouncilmessage=test" would really be output="centurycouncilmessag=#content#". anyone, using flash to talk to Cold fusion>? thanks again (and again!) Kurt At 02:49 PM 4/28/2004 +0000, you wrote: ----- Excess quoted text cut - see Original Post for more ----- Kurt Dommermuth Head Woodsman: http://www.punch-me.com Something fun for the itty bitty ones: http://www.kneebouncers.com

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Dave Francis
04/28/2004 11:23 AM

Have you coded NAMECONFLICT="OVERWRITE" ? Also check the values file.fileExisted and file.fileWasOverwritten   If cffile was sandboxed, cf would blow with an error saying so.   -adam   >   > is this a shared hosting environment?  is cffile allowed?   >   > tony   >   > Adam, had also asked if I was getting errors and I forgot to say that I   > wasn't.   >   > Tony, I used <cfoutput>#GetBaseTemplatePath()#</cfoutput> to determine where   > exactly I was in the directory structure and used this information as an   > absolute path.  still no luck.   >   > this is what it looked like when I tried that.   >   > <cffile action = "write" file =   > "D:\http\centurycouncil_org\kurt_test\write_greeting.cfm" output = "test">   >   >   > thank you,   > Kurt   >   >   >   >   > At 09:20 AM 4/28/2004 -0400, you wrote:   > >you may need to use the full path like   > >   > >c:\inetpub\wwwroot  > >   > >or it will likely throw the newly created file into some system directory   > or   > >root path of something.   > >   > >are you getting errors? or are you just not getting the file in the place   > >you are expecting?   > >   > >tony   > >   > >   > >Hi,   > >   > >I was hoping someone could help.  I am trying to do something and have   > tried   > >a ton of variations, but have had no luck.   > >   > >why won't this write to a text file?   > >   > ><cffile action = "write" file = "write_greeting.cfm" output = "test">   > >   > >thanks for any help,   > >Kurt   > >   > >Kurt Dommermuth   > >Head Woodsman: http://www.punch-me.com   > >Something fun for the itty bitty ones: http://www.kneebouncers.com

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Kurt Dommermuth
04/28/2004 11:44 AM

More follow up since there really isn't all that much info out there regarding flash passing variables to Coldfusion to text files. here's the coldfusion script in a file called "write_text_file.cfm": <cfset the_path = ExpandPath("*.*")> <cfset this_directory = GetDirectoryFromPath(the_path)> <cffile action="write" file="#this_directory#\YOUR_TEXTFILE" output="#YOUR_VARIABLE#"> and here's the flash button action. on (release, keyPress "<Enter>") {          YOUR_VARIABLE = escape(YOUR_VARIABLE);          loadVariables("write_text_file.cfm","","get");          content = ""; } Thanks all, Kurt Dommermuth At 11:06 AM 4/28/2004 -0400, you wrote: ----- Excess quoted text cut - see Original Post for more ----- Kurt Dommermuth Head Woodsman: http://www.punch-me.com Something fun for the itty bitty ones: http://www.kneebouncers.com

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Adrocknaphobia
04/28/2004 11:15 AM

Kurt, Well, you have options out the ying-yang between Flash and CF. If you are running CFMX you easiest solution would be to implement Flash Remoting. It's all of about 5 lines of Flash code to make calls directly to CF. Another options is an XML based webservice. Finally you can also just pass values to a plain old CF page through the URL. -adam ----- Excess quoted text cut - see Original Post for more -----


<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

February 08, 2012

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29