Ask a Question related to Coldfusion - Getting Started, Design and Development.
-
jaciel2005 #1
problem about pics
Hey people,im new (about 6 months) in this coldfusion stuff, im interested in
this ?technology? so im doing my own personal site,but i have problems so....
can someone help me??
Its about coldfusion, and the problem is how can i store an image(regardless
of the format)in a database? For example i understand how to get users data and
store it in a database. But when i want to store just a pic from a form,and an
input type=?file? the form receive the path to store that pic in my
server(c:\myweb\pics....)and not the name of the file.I was reading about this
and i know that the cffile.serverfile (that represent the name of the file)
variable is created after the operation, but i dont imaging how to store the
name in the database. ?Or how can i store a series of images(that are stored in
my server-pc in a folder) in a database?
I was reading that i can convert a binary file(the image) to base64(i
understand the concept)... i did it and i get something like
this(/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAcEBAQFBAcFBQcKBwUH............)but i
wanted to store (manually) to a table in access but i couldnt because the
base64 is tooooo long to store it :(
I was reading the coldfusion documentation and some other books, and
sincerely im spending mucht time just to do this(and other stuff like a message
board like this site and i dont wanna give up :) ) please someone help me
And the action page?? Well, i couldnt do it well and got http 500 error, so i
didnt included it, i know that in the action page should be a cffile tag....
aaah, sorry, i couldnt atach code, it didnt work
jaciel2005 Guest
-
Pics
Hey I've only just recently started using flash so im not that aware of what it can do!! I want to have the front page of my site to have a few... -
Help me!! problem with loading pics
Hi, I got a problem with loading pics... I read a directory in a textfield. Every line is another image name. When I get to the place where I first... -
Why are my pics so grainy?
I've been trying to do a lot of concert photography lately. I use a Nikon N65 with a Sigma 28-80mm lense with 800 film. A lot of my phots turn out... -
pics from pentax SMC 75-150 M f4 ANYONE?
Does anyone have pics taken with an pentax SMC 75-150 M f4 lens that you'd be willing to show me via a link or e-mail or something? I'm trying to... -
new pics please look
"wayne" <adfoto@datafast.net.au> wrote in message news:3f16984d@usenet.per.paradox.net.au... Contrast is a little too stark for my tastes. Lost... -
Fernis #2
Re: problem about pics
Just as a reminder - storing images in the DB isn't always the most
performance-wise option. For every image download, you'd have to do a binary
transaction from the DB.
If you want to protect your files so that others can't see the URLs of the
images, i.e. build some kind of security system, I recommend placing the images
outside the web root, and serving them using <CFCONTENT> (although that's also
somewhat consuming for ColdFusion, I think, but sometimes the only option).
Aaaanyway, I've never inserted an image into DB, but in theory it's easy.
You submit a form, right? a <CFFILE action="upload" ....> will receive the
file, after which the #cffile.serverfile# variable contains the file name. By
this, you should already know in which directory the file was uploaded, since
you define that in the upload phase.
After uploading, you read the file with <CFFILE action="readBinary".....> into
a variable (object, rather), and then you should be able to use <CFQUERY> and
<CFQUERYPARAM> to insert the image variable into a column (type BLOB or
similar).
Check out [url]http://www.forta.com/[/url] blog for how to serve images from the DB.
Fernis Guest
-
webCFDev #3
Re: problem about pics
Why don't you store only the path to the image on the db. If you know where the
image will be stored you can populate the db with the image path and grab the
image name and extension from the form entry.
webCFDev Guest
-
jaciel2005 #4
Re: problem about pics
C:\CFusionMX7\runtime\servers\coldfusion\SERVER-INF\temp\wwwroot-tmp\neotmp2090.
tmp ???This path appears in my access DB instead of c:\myserver\etc...
even if the destination attribute is c:\myserver\etc... the pic was stored in
the right folder, and users data was stored correctly except path to that
pic..grrrrr :@
the cffile.serverfile is created, right? well i tried to store this variable
whit a cfquery but it appears an error "string index out of range: -1"
jaciel2005 Guest
-
J?J #5
Re: problem about pics
just use file.serverfile (after CFFILE) to get the filename to put in your database
J?J Guest



Reply With Quote

