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

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

Explorer ,
Jun 24, 2006 Jun 24, 2006

Copy link to clipboard

Copied

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
TOPICS
Advanced techniques

Views

466

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
Community Expert ,
Jun 25, 2006 Jun 25, 2006

Copy link to clipboard

Copied

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)

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 ,
Jun 25, 2006 Jun 25, 2006

Copy link to clipboard

Copied

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

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
Explorer ,
Jun 27, 2006 Jun 27, 2006

Copy link to clipboard

Copied

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

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 ,
Jun 27, 2006 Jun 27, 2006

Copy link to clipboard

Copied

LATEST
> 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

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