[thelist] Bypass limit on memo field >> outputing to a text file auto...

Kevin krr at ix.netcom.com
Sun Aug 5 18:08:46 CDT 2001


> Message: 6
> From: ".jeff" <jeff at members.evolt.org>
> To: <thelist at lists.evolt.org>
> Subject: RE: [thelist] Bypass limit on memo field >> outputing to a text
file auto...
> Date: Sat, 4 Aug 2001 10:22:11 -0700
> charset="iso-8859-1"
> Reply-To: thelist at lists.evolt.org
>
> kevin,
>
> ><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> > From: Kevin
> >
> > How would you define the variable setup so that I can
> > create a variable to hold the file names for both the
> > cfset and the file path?
> ><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
>
> if you don't care if the filename tells you anything about the content,
then
> i'd suggest using the CreateUUID() function to create the filename.
>
> <cfparam name="form.article_id" default="0">
> <cfparam name="form.file" default="">
>
> <cfif NOT Val(form.article_id)>
> <!--- this is a new article so we need
>       to do an insert query --->
>
>   <cfset form.file = CreateUUID() & ".txt">
>   <cfset path = "F:/Inetpub/wwwroot/mysite/content/" & form.file>
>   <cffile
>    action="write"
>    file="#path#"
>    output="#Trim(form.article)#">
>
>   <cfquery name="insertarticle">
>     INSERT INTO article (title, article)
>          VALUES ('#Trim(form.title)#', '#Trim(file)#')
>   </cfquery>
>
> <cfelse>
>
>   <cfset path = "F:/Inetpub/wwwroot/mysite/content/" & form.file>
>   <cffile
>    action="write"
>    file="#path#"
>    output="#Trim(form.article)#">
>
>   <cfquery name="updatearticle">
>     UPDATE article
>        SET title = '#Trim(form.title)#'
>      WHERE id = #Val(form.article_id)#
>   </cfquery>
>
> </cfif>
>
> if you would prefer that the files have a naming scheme that's indicative
of
> the content it contains, then you might consider naming the files with
> something that tells you what table and what record in that table the file
> pertains to.
>
> <cfparam name="form.article_id" default="0">
> <cfparam name="form.file" default="">
>
> <cfif NOT Val(form.article_id)>
> <!--- this is a new article so we need
>       to do an insert query --->
>
>   <cftransaction>
>     <cfquery name="insertarticle">
>       INSERT INTO article (title)
>            VALUES ('#Trim(form.title)#')
>     </cfquery>
>     <cfquery name="getmax">
>       SELECT Max(id) AS id
>         FROM article
>     </cfquery>
>   <cfset form.file = "article_" & getmax.id & ".txt">
>   <cfset path = "F:/Inetpub/wwwroot/mysite/content/" & form.file>
>   <cffile
>    action="write"
>    file="#path#"
>    output="#Trim(form.article)#">
>   <cfquery name="updatearticle">
>     UPDATE article
>        SET article = '#Trim(form.file)#'
>      WHERE id = #Val(getmax.id)#
>   </cfquery>
>
> <cfelse>
>
>   <cfset path = "F:/Inetpub/wwwroot/mysite/content/" & form.file>
>   <cffile
>    action="write"
>    file="#path#"
>    output="#Trim(form.article)#">
>
>   <cfquery name="updatearticle">
>     UPDATE article
>        SET title = '#Trim(form.title)#'
>      WHERE id = #Val(form.article_id)#
>   </cfquery>
>
> </cfif>
>
> in this scenario you wouldn't even need to store the filename as you would
> have all the information you'd need in the name of the file itself.
>
> good luck,
>
> .jeff
>
> http://evolt.org/
> jeff at members.evolt.org
> http://members.evolt.org/jeff/


I apprecitate the insight

I have a really good idea on how to setup a practial text file
system that I can outsource to other files.

It will take some work and a little practice, But between your
pointers and the tutorial I am working thru I should get a really
good handle on it.

Now if I could only get a handle on how to work with my coldfusion
quickstore examples I would really be doing good.

I can't quite understand some of the stuff being used to build the
quickstore and so far the only response I have been able to get
is read a book!  The kinda help everyone needs right? ;-)

If you have the time to help out with this quickstore...

Thank You
Kevin






More information about the thelist mailing list