Uploading Files
ColdFusion
Do you ever have those days where you just say "man, I love
coding!!!!"? Well that happened to me this morning when I was working
on real estate site in my "free time". Of course with any real estate
site you have a lot of photos, photos for properties, photos for agents
and this site even has photos for property events, what ever those
are??!! In the old'n days I would have just written out all that
code to upload the file, move the file and rename the
file. But for this project I decided to make a File Functions cfc
file. This cfc has functions to rename, remove and upload photos.
Needless to say creating this one function to handle all my file
functions made the rest of my coding a lot easier. I
also made a series of structures in my application scope that hold
important information such as the file directory location and file
size. For example application.event.fullFilePath is the full directory
path for event photos and application.event.fileSize is the width of
those photos. I'm also using cool cfc called tmt_img.cfc to resize photos to the correct width when uploaded.
It may not be rocket science to everyone, but it sure made me think "man, I love coding!!!"
Here is my file functions cfc
Here is my code calling the file function cfc
How cool is all that???
Good Day!
Ryan





Loading....