4 Replies Latest reply on May 21, 2009 11:41 AM by brianism

    cfinvoke function

    brianism Level 1

      Hi, I am using Godaddy shared hosting and trying to use an image resize script that uses the createobject function. They say that is disabled, but cfinvoke would work.  I have little experience with either of those functions. Does someone know what I would need to do to turn the following code below to work with cfinvoke? I've read some documentation but I still can't understand what I would need to change.


      <cfset objInImage=createobject("java","java.awt.image.BufferedImage")>




        • 1. Re: cfinvoke function
          ilssac Level 5

          I'm sorry.  As far as I know, and a quick Google search can tell me, one can not use <cfinvoke...> for java objects.  <cfinvoke...> and the createObject() functions are quite interchangeable for ColdFusion components.  But java objects are a different beast that requires either createObject() or <cfobject...> to access.


          Unfortunately the very reason these two functions are disabled is that access to the underlining java on a shared host would allow malicious developers to gain more control of the server then they should have and to hack or interfere with the other clients sharing the server.  As far as I know there is no way to allow access to only benign java objects such as java.awt.image.BuffereImage and not dangerous ones such as coldfusion.server.ServiceFactory.

          • 2. Re: cfinvoke function
            craigkaminsky Level 3

            I do not believe you can use cfinvoke directly on Java objects, you'd need either createObject, as you already have, or cfobject. Did they disable cfobject as well?


            Are you on CF7 or 8? If your host has CF8, you can use the new cfimage tag to quickly and easily resize your image. On 7, you can try ImageCFC but it'll probanly have the same issue you're experiencing since it relies on CF's Java libraries:


            1 person found this helpful
            • 3. Re: cfinvoke function
              ilssac Level 5

              Godaddy's ColdFusion offerings are ColdFusion 7 unfortunatly.


              I'm affraid your only likely choice is another hosting provider that better matches your needs.  I'm not even sure that Godaddy would allow you to install any of the custom tags that allowed image manipulations in older verions of ColdFusion.  While I happily use Godaddy for my personal vanity site.  I recognize them as offering a very limited version of ColdFusion and do not rely on their custermer support for anything.

              • 4. Re: cfinvoke function
                brianism Level 1

                Looks like I need to find another host for things like this.  Thank you guys for the help.