|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
ColdFusion newbie trying to write to a txt file
Hi,Kurt Dommermuth 04/28/04 09:18 A you may need to use the full path likeTony Weeg 04/28/04 09:23 A Kurt Dommermuth wrote:Stephen Moretti 04/28/04 09:27 A Adam, had also asked if I was getting errors and I forgot to say that I wasn't.Kurt Dommermuth 04/28/04 09:37 A is this a shared hosting environment? is cffile allowed?Tony Weeg 04/28/04 09:39 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 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?Adrocknaphobia 04/28/04 09:21 A Hi Adam,Kurt Dommermuth 04/28/04 09:34 A If cffile was sandboxed, cf would blow with an error saying so.Adrocknaphobia 04/28/04 10:52 A Just a follow-up. the guy who normally does CF gave me this as a solution.Kurt Dommermuth 04/28/04 11:06 A Have you coded NAMECONFLICT="OVERWRITE" ? Also check the valuesDave Francis 04/28/04 11:23 A More follow up since there really isn't all that much info out thereKurt Dommermuth 04/28/04 11:44 A Kurt,Adrocknaphobia 04/28/04 11:15 A 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 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 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 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 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 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 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 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 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 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 ----- 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 If cffile was sandboxed, cf would blow with an error saying so. -adam ----- Excess quoted text cut - see Original Post for more ----- 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 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 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 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 -----
|
February 08, 2012
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||