Copy link to clipboard
Copied
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?
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
...Copy link to clipboard
Copied
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).
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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).
Copy link to clipboard
Copied
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#"