zakaz
asked on
Read from directory add to db
Hello,
I am running CFMX 7 on our own server Win 2003. 800gb space,
I have just set up a new web directory structure with over 6000 images in it set up like below.
wwwroot/pics/summmer/img_2 453663_663 55.jpg
wwwroot/pics/summmer/img_2 453663_663 56.jpg
wwwroot/pics/summmer/img_2 453663_663 57.jpg (etc)
wwwroot/pics/winter/img_24 53663_6631 1.jpg
wwwroot/pics/winter/img_24 53663_6631 1.jpg (etc)
Lots of folders with hundreds of images in each.
What i need to do is for coldfusion to read the name of the images, and store it and it's route on a db (don't worry about the storage code that is not a problem)
Something behind this... I have an co located server with 600 thumbnails on it live, the order form is currently sent to the account manager who finds the 300dpi image on the server and sends it out on a CD, as you can see this is not the best way.
What i have is set up our inhouse server with the 300dpi images on, i am going to pass the image name accross from the current order form and send out the image.
I do not want to type in 6000+ image names and locations?
Please any help?
I am running CFMX 7 on our own server Win 2003. 800gb space,
I have just set up a new web directory structure with over 6000 images in it set up like below.
wwwroot/pics/summmer/img_2
wwwroot/pics/summmer/img_2
wwwroot/pics/summmer/img_2
wwwroot/pics/winter/img_24
wwwroot/pics/winter/img_24
Lots of folders with hundreds of images in each.
What i need to do is for coldfusion to read the name of the images, and store it and it's route on a db (don't worry about the storage code that is not a problem)
Something behind this... I have an co located server with 600 thumbnails on it live, the order form is currently sent to the account manager who finds the 300dpi image on the server and sends it out on a CD, as you can see this is not the best way.
What i have is set up our inhouse server with the 300dpi images on, i am going to pass the image name accross from the current order form and send out the image.
I do not want to type in 6000+ image names and locations?
Please any help?
Are you wanting to do this as images are uploaded to the server as part of a web app? Do you just want to be able to find an image based upon it's name? There are a couple of different approaches based upon your unique requirements and all should be rarther simple. Can you give us a little more information to work with?
I'm not sure exactly how to go about this,
but what I believe he is asking is how to dynamically populate a database record say "Image_Name" with the name of images in a directory (he says about 600 worth) and store another value "Image_Location" with the path to those images in a table without having to hand cramp everything to the table...
by say storing the values as variables and doing an SQL insert to update his new database.
I would also be interested if you have an easy way of doing this!
I think then he can use this table to call images on a variety of pages with his new database..?
Regards,
~trail
but what I believe he is asking is how to dynamically populate a database record say "Image_Name" with the name of images in a directory (he says about 600 worth) and store another value "Image_Location" with the path to those images in a table without having to hand cramp everything to the table...
by say storing the values as variables and doing an SQL insert to update his new database.
I would also be interested if you have an easy way of doing this!
I think then he can use this table to call images on a variety of pages with his new database..?
Regards,
~trail
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Excellent work you guys,
I will give these a taet today,
Thank You all,
Chris
I will give these a taet today,
Thank You all,
Chris
ASKER
<p>The template path of the current page is:
<cfoutput>#GetCurrentTempl atePath()# </cfoutput >
<cfdirectory action="list" name="pics" directory="E:\wwwroot\Clie nts\b\bdw\ images\" >
<p>
<cfloop query="pics">
<cfdirectory action="list" name="this" directory="E:\wwwroot\Clie nts\b\bdw\ images\#pi cs.name#">
<cfloop query="this">
<!--- this.name contains all the file names in your directory --->
<cfoutput>#this.directory# #this.name #</cfoutpu t>
<!--- You can use this info to store in db --->
</cfloop>
</cfloop>
<cfoutput>#GetCurrentTempl
<cfdirectory action="list" name="pics" directory="E:\wwwroot\Clie
<p>
<cfloop query="pics">
<cfdirectory action="list" name="this" directory="E:\wwwroot\Clie
<cfloop query="this">
<!--- this.name contains all the file names in your directory --->
<cfoutput>#this.directory#
<!--- You can use this info to store in db --->
</cfloop>
</cfloop>
This is just an idea and somthing I haven't tried before, but may be of some use???
<cffile action = "read"
file = "../pics/summmer/"
variable = "pic_locations" >
<cfoutput>#pic_locations#<
I don't have any idea if this will work, at the moment I don't have anythnig to test on either :o)
just an idea...