Skip to main content
Hedge
Inspiring
January 2, 2010
Answered

CFIMAGE not working when there is a . in the file path?

  • January 2, 2010
  • 4 replies
  • 689 views

I’m trying to use CFIMAGE for the first time and running into an issue. I am guess it is because my path has a period in it but I am not sure and I am not sure how to get around it if that is indeed the problem.

I’m using ExpandPath to get the directory path but I have tried it other way with the same result. The path is

C:\Websites\mywebsite.com\www\images

I’m just trying to take a file in the C:\Websites\mywebsite.com\www\images\temp directory and resize it then rename it to the memberid with 300 on the end and save it to this directory C:\Websites\mywebsite.com\www\images\members

        <cfimage

        action = "resize"

        height = ""

        source = "#ExpandPath("..\images")#\temp\#TempFileName#"

        width = "300"

        optional

        destination = "#ExpandPath("..\images")#\members\"

        name = "#ARGUMENTS.MemberID#300"

        format = "jpg"

        overwrite = "yes">

I keep getting the folowing error.

The com\www\images\members\ image format is not supported on this operating system.

Any ideas?

This topic is closed to new replies. Start a new post to keep the conversation going.
Correct answer -__cfSearching__-

I am guess it is because my path has a period in it

I have no problems using a path with a "." in it. It is more likely that your path is not valid. Output the source path you are attempting to use. Is it valid? Using FileExists(), does that file actually exist?

#ExpandPath("..\images")#\temp\#TempFileName#

        <cfimage

        optional

        destination =

"#ExpandPath("..\images")#\members\"

        name = "#ARGUMENTS.MemberID#300"

Did you intend to use both destination and name? (I am guessing the "optional" is a typo since it is not an attribute of cfimage).

4 replies

BKBK
Community Expert
Community Expert
January 3, 2010

The operating system apparently thinks the dot before com means a file extention. What if you use single quotes instead, like this,

"#expandPath('..\images')#\temp\#TempFileName#"


If that fails, then perform the next experiment. What happens when you spell it out, like this

"C:\Websites\mywebsite.com\www\images\temp\#TempFileName#"

-__cfSearching__-Correct answer
Inspiring
January 2, 2010

I am guess it is because my path has a period in it

I have no problems using a path with a "." in it. It is more likely that your path is not valid. Output the source path you are attempting to use. Is it valid? Using FileExists(), does that file actually exist?

#ExpandPath("..\images")#\temp\#TempFileName#

        <cfimage

        optional

        destination =

"#ExpandPath("..\images")#\members\"

        name = "#ARGUMENTS.MemberID#300"

Did you intend to use both destination and name? (I am guessing the "optional" is a typo since it is not an attribute of cfimage).

Hedge
HedgeAuthor
Inspiring
January 3, 2010

I tried all the FileExists and everything and in the end it was the fact that I ahd both destination and name being used at the same time.

Which really stinks because all I did was copy and paste from Adobe's example. Thanks for the help.

Inspiring
January 3, 2010

was the fact that I ahd both destination and name being used

at the same time.

Using both "destination" and "name" works fine for me on windows. Though as I said, it is usually more common to use one or the other (not both).

all I did was copy and paste

from Adobe's example.

Given the fact that your code contained the word "optional", you may have inadvertently copied a usage/syntax description rather an actual code example. Most of the descriptions contain the word "optional" to separate the mandatory and optional attributes. They are just descriptions not working code. Look for the actual code examples further down in the page (usually in a mono-font like courier).