Re: cfcontent create file

2009-10-14 Thread James Holmes

You want cfsavecontent, not cfcontent.

Write the contents of the cfsavecontent variable into a file with cffile.

mxAjax / CFAjax docs and other useful articles:
http://www.bifrost.com.au/blog/



2009/10/14 Richard White rich...@j7is.co.uk:

 hi

 we are using cfcontent and rich text to create a word doc as follows:

 cfcontent 
 type=application/mswordcfoutput{\rtf1\ansi\ansicpg1252\uc1\deff0\stshfdbch0
  etc.../cfoutput

 however when we run the cfm page it brings up the download option, whereas we 
 want to create the file and store it on the server

 can anyone help with this?

 thanks

 richard

 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:327189
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: cfcontent create file

2009-10-14 Thread Mark Kruger

Richard,

You don't really need CFCONTENT (which actually sets up headers in the
browser). You are not trying to send your content to the output buffer of
IIS. Try cfsavecontent instead.

cfsavecontent variable=content

{\rtf1\ansi\ansicpg1252\uc1\deff0=stshfdbch0 etc...

/cfsavecontent

cffile action=write output=#content# file=full file and path
name.rff/



-Mark 


Mark A. Kruger, CFG, MCSE
(402) 408-3733 ext 105
www.cfwebtools.com
www.coldfusionmuse.com
www.necfug.com

-Original Message-
From: Richard White [mailto:rich...@j7is.co.uk] 
Sent: Wednesday, October 14, 2009 10:57 AM
To: cf-talk
Subject: cfcontent create file


hi

we are using cfcontent and rich text to create a word doc as follows:

cfcontent
type=application/mswordcfoutput{\rtf1\ansi\ansicpg1252\uc1\deff0\stshfd
bch0 etc.../cfoutput

however when we run the cfm page it brings up the download option, whereas
we want to create the file and store it on the server

can anyone help with this?

thanks

richard 



~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:327190
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: cfcontent create file

2009-10-14 Thread Joshua Rowe

This should work for you:


cfsavecontent variable=myContent
This is the content that will go into my .doc file.
This is a test.
/cfsavecontent

cffile action=write
file=#Replace(ExpandPath('*.*'),'*.*','')#test.doc
output=#myContent#


Best regards,
Joshua Rowe


-Original Message-
From: Richard White [mailto:rich...@j7is.co.uk] 
Sent: Wednesday, October 14, 2009 8:57 AM
To: cf-talk
Subject: cfcontent create file


hi

we are using cfcontent and rich text to create a word doc as follows:

cfcontent
type=application/mswordcfoutput{\rtf1\ansi\ansicpg1252\uc1\deff0\stshfd
bch0 etc.../cfoutput

however when we run the cfm page it brings up the download option, whereas
we want to create the file and store it on the server

can anyone help with this?

thanks

richard 



~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:327191
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: cfcontent create file

2009-10-14 Thread Richard White

thanks, that is exactly what we wanted

richard 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:327192
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: cfcontent create file

2009-10-14 Thread Ian Skinner

Joshua Rowe wrote:
 This should work for you:


 cfsavecontent variable=myContent
   This is the content that will go into my .doc file.
   This is a test.
 /cfsavecontent

 cffile action=write
   file=#Replace(ExpandPath('*.*'),'*.*','')#test.doc
   output=#myContent#


 Best regards,
 Joshua Rowe
But a 'doc' file type is a binary file type is it not?  In my experience 
you can't just write simple text to a with a doc extension and get 
anything useful.  I could see this working with an plain text (.txt) or 
rich text (.rtf) extension, but not a .doc extension.

To create binary .doc types I believe you need to use the Word com 
object or the Java POI utilities do you not.

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:327193
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: cfcontent create file

2009-10-14 Thread Rick Root

On Wed, Oct 14, 2009 at 12:32 PM, Ian Skinner h...@ilsweb.com wrote:

 But a 'doc' file type is a binary file type is it not?  In my experience
 you can't just write simple text to a with a doc extension and get
 anything useful.  I could see this working with an plain text (.txt) or
 rich text (.rtf) extension, but not a .doc extension.

you can test this easily.  Put a .txt file on your desktop with some
content in it, rename it to a .doc and open it.

It works just fine, at least in Word 2007 it does.  I could test Word
2000 at home..

Word does format detection to figure out what KIND of word doc it is.
It'll realize that his file is an RTF document, and it'll realize that
your plain text document (tested above) is a text document, and
display it just fine.

Same way you can write HTML tables to a file, save it with a .XLS
extension, and have it open in Excel.

Ri

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:327210
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4