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

CFImage writing function

Participant ,
Feb 23, 2009 Feb 23, 2009

Copy link to clipboard

Copied

When I try to write a file to a directory it asks me to verify if CF has rights to perform that operation. So my program breaks. This should not be a hard one. Any thoughts?

Thanks!
TOPICS
Advanced techniques

Views

1.0K

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
Valorous Hero ,
Feb 23, 2009 Feb 23, 2009

Copy link to clipboard

Copied

Assuming you have already eliminated the obvious causes:
1) Directory/file path is invalid
2) CF does _not_ have permission to write information to that directory

Check your patch level. There was an image hotfix to fix issues with locked files
http://kb.adobe.com/selfservice/viewContent.do?externalId=kb403411&sliceId=1

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
Participant ,
Feb 23, 2009 Feb 23, 2009

Copy link to clipboard

Copied

And how do you verify if CF has permission to write in that directory?

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
Participant ,
Feb 23, 2009 Feb 23, 2009

Copy link to clipboard

Copied

I solved this issue. Now what about when the source of your image is random? I need to upload images from multiple locations not just the local directory where the cfm files reside.

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
Valorous Hero ,
Feb 24, 2009 Feb 24, 2009

Copy link to clipboard

Copied

So what was the issue?

apocalipsis19 wrote:
> I need to upload images from multiple locations not just the local directory where the cfm files reside.

I assume you mean use cffile to upload files to different locations? Just change the "destination" path to point to the desired directory. The same applies if you are using cfimage. You just change the "destination" path.

<cfimage
action="write"
source="#sourceImageOrPath#"
destination="c:\some\Other\Folder\someImage.png"
...
>

http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=Tags_i_02.html


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
Participant ,
Feb 24, 2009 Feb 24, 2009

Copy link to clipboard

Copied

I solved that issue already. Thanks.

I am using CFImage. The problem now is my source file. My program only lets me select image files from the same location where my cfm files are. If I upload a file let's say from my pictures, the program breaks and it says that it can't find the file in location: location_where_cfm_files_are_located. So it only lets me pick images that are in the same folder as my CFM files.

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
Participant ,
Feb 24, 2009 Feb 24, 2009

Copy link to clipboard

Copied

Another way to put my question is: DO I always have to specify the source directory of my picture or I can select an image from anywhere in my network?

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
LEGEND ,
Feb 24, 2009 Feb 24, 2009

Copy link to clipboard

Copied

when in doubt - check the docs!

from <cfimage> cfml reference:

source = "absolute pathname|pathname relative to the web
root|URL|#cfimage variable#"

- URL of the source image; for example,
" http://www.google.com/images/logo.gif"
- Absolute pathname or a pathname relative to the web root;
for example: "c:\images\logo.jpg"
- ColdFusion image variable containing another image, BLOB,
or byte array; for example, "#myImage#"
- Base64 string; for example,
"data:image/jpg;base64,/9j/4AAQSkZJRgABAQA.............."


Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/

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
Participant ,
Feb 24, 2009 Feb 24, 2009

Copy link to clipboard

Copied

I always check the docs and by the way they SUCK. That being said, thank you for your response but I know that already. I have 8 servers in my network and as of now, I have to specify the path in my code of where the image is coming from (SOURCE). I want to make my program that the image is read by CFIMage regardless of the location of the picture. So far I have to code EVERYWHERE where my source file is: source="//webdata/development/webimages/image.jpg" I dont want to havr to do that! Because I want to select images from anywhere in my network.

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
LEGEND ,
Feb 24, 2009 Feb 24, 2009

Copy link to clipboard

Copied

apocalipsis19 wrote:
> I can select an image from anywhere in my network?

The default install of ColdFusion usually only has permissions to read
and write to directories on the server on which it is installed.

If you want it to have permissions to resources on other servers you
have to configure it to run as a user that has those permissions. How
you do this depends on whether you are using Windows or Unix servers.

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
LEGEND ,
Feb 24, 2009 Feb 24, 2009

Copy link to clipboard

Copied

apocalipsis19 wrote:
> Because I want to select images from anywhere in
> my network.
>

hmm... how do you expect <cfimage> to *guess* where exactly it should
get the image from? :)
there's no way cf can 'guess' where myimage.gif is located - that's what
the SOURCE attribute is for: to tell it where to fetch the image from.
by default it will look in the same location the page with <cfimage> tag
is located in. that's why SOURCE is a REQUIRED attribute.

or do you mean that your same codebase on different servers should be
accessing a different, server-specific, images location?

you could set an application-scope var...
or maybe better just create a cf mapping to the location of your images...
and use that as SOURCE value

sorry if i still have guessed your question wrong - maybe you should try
to explain your network setup and how and where your application runs a
bit more...


Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/

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
Participant ,
Feb 24, 2009 Feb 24, 2009

Copy link to clipboard

Copied

Thanks Ian!

I will check all my permissions and such on CF Admin. All my servers are Windows except one that we use to test some functionality. I will post on here how I make out with this situation.

Thanks!

Ysais.

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
Participant ,
Feb 24, 2009 Feb 24, 2009

Copy link to clipboard

Copied

LATEST
Azadi,

Thank you! You did not guess wrong. I thought there was a way to tell teh source attribute to automatically pick up the directory the image was coming from. Fair enough. That's all I needed to know.

Thanks again!

Ysais.

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