What's the first error message you get?
(Or perhaps it's not an error message, but what you expect
to happen, doesn't...)

Also, one of the first things to do is make sure all the variables
you're setting are accurate...run some <cfoutput>'s and check what
you're getting for variables, like this:

<cfset imageDirPath = ExpandPath("user_photos")>
<cfoutput>#imageDirPath#</cfoutput>

Once you run that make sure the "imageDirPath" is what you expect it to be.

Is it?

Rick

-----Original Message-----
From: Barry Mcconaghey [mailto:[email protected]] 
Sent: Saturday, December 12, 2009 1:28 PM
To: cf-talk
Subject: Re: Working With Images...Still looking


Hi Rick...Thanks for your time!

Tony's link did not work and I sent him an email via his contact form. No
reply so far.

Here is an example of what I'm looking for but only that I want to add
images to the ArtistID. I understand all this code in this example. The
problem is with the images.

http://tutorial40.learncf.com/

Run this demo:

http://tutorial40.learncf.com/demo/40

This is an interface I like to use to add news and photos for the fire
department's website.

Here is the code I want to use:

<cfset imageDirPath = ExpandPath("user_photos")>


<cfif isDefined("form.fileToUpload") and form.fileToUpload neq "">
        <cfset userPhotoPath = "#imageDirPath#/user_#form.ArtistID#.jpg">
        <cfset userThumbPath =
"#imageDirPath#/user_#form.ArtistID#_thumb.jpg">
        <!--- Accept the file upload --->
        <cffile 
            action="upload"
            destination="#getTempDirectory()#"
            fileField="fileToUpload"
            nameconflict="makeunique">

        <!--- Get info about the photo --->
        <cfimage
                action="info"
                source="#cffile.serverDirectory#\#cffile.serverFile#"
                structName="uploadedFileInfo">

        <cfif uploadedFileInfo.width lt 100 
           or uploadedFileInfo.height lt 100
           or uploadedFileInfo.width gt 1000
           or uploadedFileInfo.height gt 1000>
                <!---<cfthrow message="Please provide an image between 100
and 1000 pixels tall and wide.">--->
        <cflocation url="upload_error.cfm">
        </cfif>

        <!--- Convert the photo --->
        <cfimage
        action="resize"
        width="300"
        height="300"
        source="#cffile.serverDirectory#\#cffile.serverFile#"
        destination="#userPhotoPath#"
        overwrite="true">
            
        <!--- Resize the photo to create a thumbnail --->    
        <cfimage
                action="resize"
                width="100"
                height="100"
                source="#userPhotoPath#"
                destination="#userThumbPath#"
                overwrite="true">
                
</cfif>

Thanks Barry.

>Barry...
>
>Have you used cfimage before?  Are you familiar with uploading
>images through a form?
>
>I know these are basic questions, and forgive me if these insult
>your level of experience, but your questions seem to indicate that
>you're uncertain of how to implement file uploading and manipulation.
>
>I'm just trying to get a handle on what your current level of knowledge
>and experience is so I can know best how to help you.
>
>I work with images every day and built interfaces (forms, basically) to
>upload them, along with using cfimage to resize (I don't crop in cfimage),
>rename, move, etc., the images on the server, as well as handling the
>storage of the images on the server and filenames in databases, and
finally,
>displaying those images on the web.
>
>This process really just involves forms, server-side ColdFusion hanlding of
>the
>images with the cfimage tag and queries for database work.
>
>I don't have a packaged solution to offer you, as I typically write code
>specific
>to the website task at hand.
>
>Can you explain at what point you need help?
>
>Perhaps, understanding of file uploading via a form?
>
>Again, I hope these questions aren't insulting...they're just meant to help
>me understand your needs.
>
>Rick
>
>Any Help ?
>
>I am still looking for an interface that allows me to add a new image
>record, update a current image record, or delete a current image record
with
>CF8.
>
>Thanks,
>
>Barry 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:329130
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to