hi,
I have a system built to create a new gallery item.
this creates a new entry into the database, (GalleryID and GalleryName)
and then creates a matching folder directory with the GalleryName,
from the name field via the form (FORM.GalleryName)
my problem comes when attempting to change the name of the directory.
I set my query to only select data from the galleryID passed in the URL string,
then I cfset the curretdirectory to the database gallery name,
and I then rename the newdirectory to the FORM.GalleryName
I submit the form to Script_Self, but then the page re-parces,
re-runs the database query, and pulls the first gallery name it fines,
so now it looks for the first database gallery name,
and trys to replace THAT directoy,
when I submit the page, it forgets every thing I've set
with the first database gallery name it finds.
<!---QUERY MY DATA HERE--->
<cfif IsDefined("SubmitBtn") AND SubmitBtn EQ "form1">
<cfset currentDirectory = #GalleryPath# & #Database.theGalleryName#>
<cfset newDirectory = "#FORM.theGalleryName#">
<cfdirectory action = "rename" directory = "#currentDirectory#" newdirectory=
"#newDirectory#" >
<!---UPDATE THE DATABASE HERE--->
<cflocation url="/ml/admin/gallery/index.cfm">
</cfif>
the only alternative I can come up with,
is once the user creates a gallery name,
it can not be changed, and I think thats kinda wack :-\
--
thanks,
DH
____________________________________
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create Web Applications With ColdFusion MX7 & Flex 2.
Build powerful, scalable RIAs. Free Trial
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:273653
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4