Closed (duplicate)
Project:
Drupal core
Version:
x.y.z
Component:
upload.module
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Mar 2006 at 15:40 UTC
Updated:
16 Mar 2006 at 17:51 UTC
If any user who is not the root user (e.g. uid !=1 ) tries to upload a file they get
"The selected file can not be attached to this post, because it is only possible to attach files with the following extensions: jpg jpeg gif png txt html doc xls pdf ppt pps."
The root/uid=1 user can upload files without any errors.
I think this came out of fixes related to http://drupal.org/node/43220 and earlier.
Comments
Comment #1
kkaefer commentedI can confirm this bug.
Comment #2
deekayen commentedI wasn't able to confirm this as written, but I did uncover some annoyances.
1) if txt is an allowed filetype, uploading a file with TXT in caps doesn't match, when really there's no functional difference. Maybe need to add compare using strtolower()?
2) Once the incorrect file upload attempt prints the error message, you can't get rid of the file. The file is in the list as a regularly uploaded file, when really the check should delete it and not list it. When I try to click the delete checkbox for the file and submit, it keeps the file listed and re-presents the error.
Comment #3
pulsifer commentedUser uid == 1 can upload files with any extension. All other users can only upload the allowed extensions, if they are permitted to upload at all. What was the full name of the file you were trying to upload?
Comment #4
deekayen commentedLet me revise what I just said. The caps thing isn't a problem and now I'm not able to reproduce the deletion problem.
I didn't clean out the tmp directory and uploaded the same file I did in my earlier testing and now I'm getting "warning: getimagesize(): Read error! in E:\Web\drupal47b6\includes\image.inc on line 89." for some reason which for now I will blame on something I did wrong.
I'm with pulsifer on this one. Maybe rar's file just didn't have an allowed extension.
Comment #5
pulsifer commentedquote: if txt is an allowed filetype, uploading a file with TXT in caps doesn't match
Are you sure about this? upload.module reads:
This is voodoo of course (its a regex), but I believe the "/i" part is supposed to make it a caseless match.
Comment #6
deekayen commentedI jumped the gun. Just ignore me - I'll go crawl back in my contrib hole and (try to) stay out of the core playground.
Comment #7
rar commentedhere's the methodology that I get to reproduce the error.
The error occurs at the "submit stage." Notice that the error message doesn't identify the file name so there is something not being set in $_FILES when uid != 1.
Comment #8
samc commentedAdditional details can be found here: http://drupal.org/node/54298