Copy link to clipboard
Copied
So I have a URL as a string in a variable and I'm trying the following:
<cfimage action="read" name="myImage" source"#myUrlString#">
And I get the following error:
faultCode:Server.Processing faultString:'Unable to invoke CFC - An exception occurred while trying to read the image.' faultDetail:'File C:\Inetpub\wwwroot\my\cfc\path\"https:\my.domain.com\imagefile.jpg" does not exist.'
Clearly it's prepending the path to the .cfc file onto the URL String. How do I get cfimage to just load the image from the URL without it trying to prepend the .cfc file's path onto it?
(I've also tried ImageRead and ImageNew with exactly the same results).
Thanks,
Laurence MacNeill
Mableton, Georgia, USA
Yes it was me putting dummy code into my question... Sorry...
I did figure out the problem just a few minutes ago, however.
Turns out the URL string had quotes around it. Oops...
So my URL variable contained "https://my.domain.com/imagefile.jpg" *including* the quotes... Once I removed the quotes from the string, it works.
Thanks,
L.
Copy link to clipboard
Copied
So from that error message it looks like your URL is like:
https:\my.domain.com\imagefile.jpg
Which isn't a valid format URL. It should be like:
https://my.domain.com/imagefile.jpg
This may just be you putting dummy code into your question, but worth checking anyway.
Also you may need to URL encode the filepath, read this article:
http://www.raymondcamden.com/index.cfm/2013/1/9/CFImage-and-paths-with-spaces
Copy link to clipboard
Copied
Yes it was me putting dummy code into my question... Sorry...
I did figure out the problem just a few minutes ago, however.
Turns out the URL string had quotes around it. Oops...
So my URL variable contained "https://my.domain.com/imagefile.jpg" *including* the quotes... Once I removed the quotes from the string, it works.
Thanks,
L.