Metadata
- Source
- FLUID-2198
- Type
- Bug
- Priority
- Major
- Status
- Closed
- Resolution
- Won't Fix
- Assignee
- Jonathan Hung
- Reporter
- Jonathan Hung
- Created
2009-02-04T15:40:57.000-0500 - Updated
2014-04-02T16:35:55.229-0400 - Versions
-
- 0.7
- Fixed Versions
- N/A
- Component
-
- OSDPL
Description
A bug in imagefield.js javascript file causes a "The file ____ is not supported. Only the following file types are supported" on all valid images except JPGs.
This is a documented bug here: http://drupal.org/node/352939
Temporarily fixed this bug by modifying the imagefield.js file to properly accept other valid file types.
Waiting for an official patch.
Environments
OSDPL
Comments
-
Jonathan Hung commented
2009-03-30T13:55:16.000-0400 iteration30
ongoing issue.
-
Jonathan Hung commented
2009-04-16T16:59:30.000-0400 Solution as seen on http://drupal.org/node/352939
Description
1) CCK 5.x-1.10
2) ImageField 5.x-2.2
3) 755 permission, www-data owner for files/ directory; 777, root for tmp/ directory
4) private download method
5) configuration (all that matters):
Permitted upload file extensions: jpg jpeg png gif
6) I expect to be able to upload all 4 types of files (jpg jpeg png gif)
7) I can only upload the first file type (jpg). A javascript alert box appears when trying to upload jpeg, png or gif files.
8) Create new content type
Create imagefield cck field with the 4 file types above
Create new node, try to upload picture with extension jpeg, png, gif
An alert box is displayed saying you can't upload the image.I have investigated this problem and found that it is caused by a non-global javascript replace function. The function call on line 14 of imagefield.js
accept = this.accept.replace(',','|');only replaces the first comma (the one separating jpg and jpeg). Taking the configuration above, the value of accept would be set to 'jpg|jpeg,png,gif'. It should be 'jpg|jpeg|png|gif'. The correct replace function is
accept = this.accept.replace(/\,/g,'|');