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

cfimage won't load image from a URL

Contributor ,
Nov 27, 2013 Nov 27, 2013

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

Views

868

Translate

Translate

Report

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

Contributor , Nov 27, 2013 Nov 27, 2013

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.

Votes

Translate

Translate
Engaged ,
Nov 27, 2013 Nov 27, 2013

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

Votes

Translate

Translate

Report

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 ,
Nov 27, 2013 Nov 27, 2013

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

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
Documentation