4 Replies Latest reply on Jun 27, 2006 5:17 AM by Newsgroup_User

    CFILE  - accept="image/*"  MIME type error

    j_mcwatters
      Hi,

      I'm using cfile to upload images to my hosting server, but my Catch error keeps being thrown, and I can't figure it out.

      *** I have checked with my hosting admin, and cffile is enabled.

      This code works fine on my dev server, but when I moved it up to my hosting server,

      Here is my code;

      I've tried, removing the accept property from the cffile tag, and changed I have tried changing it to accept="image/gif" and tried uploading a .gif but still no joy.

      If anyone could shed some light on this, I would be greatful'

      - J
        • 1. Re: CFILE  - accept="image/*"  MIME type error
          BKBK Adobe Community Professional & MVP
          1)Is application.fullPathPhotos a full path to a directory, ending in a backslash (e.g. c:\uploads\myPics\)?

          2)filefield="photo" (without the form prefix)

          • 2. Re: CFILE  - accept="image/*"  MIME type error
            Level 7
            A good place to start would be to <cfrethrow> the exception in your
            <cfcatch> block so you can see what the actual error is, without having to
            guess...

            --
            Adam
            • 3. Re: CFILE  - accept=&quot;image/*&quot;  MIME type error
              j_mcwatters Level 1
              Thanks for your suggestions guys,

              Both of your suggestions have lead me to this question.
              My path to the upload folder looks like this, "www.mywebsite.com/projectname/imgs/photos/ ". Every example I have seen, has been to use a full path starting with c:/.
              Does it matter that I'm using a domain name as the path?

              Here is what I got back from the <cfrethrow> tag;

              Security: The requested template has been denied access to http:\www.mywebsite.com\projectname\imgs\photos.
              The following is the internal exception message: access denied (java.io.FilePermission http:\www.mywebsite.com\projectname\imgs\photos read)

              Resources:
              Enable Robust Exception Information to provide greater detail about the source of errors. In the Administrator, click Debugging & Logging > Debugging Settings, and select the Robust Exception Information option.
              Check the ColdFusion documentation to verify that you are using the correct syntax.
              Search the Knowledge Base to find a solution to your problem.


              Browser Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
              Remote Address 61.228.89.11
              Referrer http://www.mywebsite.com/projectname/admin/addEntry.cfm
              Date/Time 27-Jun-06 07:47 PM

              ------

              I noticed that on the error page, the directory that has denied acces only has 1 "\" after the http:
              I've double checked my code, and both "\"'s are there.
              Could that be the problem?

              Thanks for any help you can offer, this thing is driving me crazy. ;)

              - J
              • 4. Re: CFILE  - accept=&quot;image/*&quot;  MIME type error
                Level 7
                > Does it matter that I'm using a domain name as the path?

                Yes, very much so.

                Having an HTTP URL there makes no sense at all. It might make sense if you
                had a file URI there (not an HTTP one), but not sure if it would work. it
                should be a file-system path.

                --
                Adam