Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

Contributor ,
Jan 02, 2010 Jan 02, 2010

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?

TOPICS
Advanced techniques
684
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Valorous Hero , Jan 02, 2010 Jan 02, 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

...
Translate
Valorous Hero ,
Jan 02, 2010 Jan 02, 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).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jan 03, 2010 Jan 03, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Jan 03, 2010 Jan 03, 2010
LATEST

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).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 03, 2010 Jan 03, 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#"

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources