Closed (fixed)
Project:
Web File Manager
Version:
6.x-2.18
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 Jan 2012 at 13:09 UTC
Updated:
24 Jun 2012 at 18:41 UTC
Jump to comment: Most recent file
Comments
Comment #1
aiphesin addition : upload are allowed for www.ndd.com/webfm but not via fckeditor...but i've this error :
lycee-metiers.jpg has an invalid extension
Comment #2
aiphesnew info after update to 2.18:
if someone know
Comment #3
nhck commentedthis
says you do not have a webfm_file table. Did you check your database if it exists?
As for the allowed upload:
Can you upload that file through the webfm interface at example.com/webfm?
Comment #4
aiphesyes as #1
why webfm_file table didn't exist ? update could create this table not ?
with 2.16 patched for mime type all works but issue with 2.18...
Comment #5
nhck commentedDear aiphes,
^.
This is an error with your website and your database. The update did not change nore create any tables. As I told you you need to check if this table exists in your database. If it does not you need to reinstall webfm.
2.
Also there is no such error "File Information Extension Activated" - there is only one if you do not activate the file information extension. I don't know what patch you are talking about or if that patch was successfull for you. We make the File Information Extension a requirement for webfm because it is the only safe way to tell if an uploaded file actually is what it pretends to be.
3.
This error just means that you are either not allowed to upload that type of file or that you are trying to upload a jpg file which really isn't one.
If you expierience this - why not try to upload a different file? Or check the upload-settings for this file?
Comment #6
aiphesok i will do a downgrade to 2.16 patched version which works...because file extension issue come from webfm here : http://drupal.org/node/1109382 , so is it fixed in 2.18 ?
Comment #7
nhck commentedIssue #1109382: V2.15 Image Exploit Checking Problems (invalid function call/ invalid extension errors) that you are referring to was already fixed in 2.16 - so there is no need for patching that version. From 2.16 to 2.18 only minor issues were incorporated.
Comment #8
aiphesi've reinstall webfm in 2.18 for one of my websites and all works except the mime type file ..i've these settings
and i've this message: plan-cg-02.jpg has an invalid extension , strange no ?
Comment #9
mducharme commentedThis is still not fixed in 2.18. Either the patch was not rolled into it or there is a separate, related issue. I am going to test the latest dev version since it was mentioned here http://drupal.org/node/1109382#comment-5060870 that is was in the latest dev. If the error persists I'll post my environment details.
Comment #10
nhck commentedWell you will need to because the issue was fixed in 2.15 already. Sorry to trouble you guys with this. I just really need more information. If the fileinfo-extension is not present we fall back to mime_content_type() and if thats not present we fall back to a drupal function file_get_mimetype().
That being said you can try one thing for me to debug:
In line 3119 in webfm.module try to change it from
$err_msg[] = t('%filename has an invalid extension', array('%filename' => $file->filename));to
Can you post the result here? I've read some comments that due to a strange configuration of apache it could be that mime_content_type() always returns 'text'...
Thank you.
Comment #11
mducharme commentedI updated the code as per your suggestion and the $mimetype output is just an empty string.
myfile.jpg has an invalid extension. It is really:I have fileinfo extension enabled. phpinfo shows it is enabled and the drupal status report shows:
File Information Extension EnabledManually running
extension_loaded('fileinfo');returns 1.Uploading file types like
file.txtworks just fine.Server Version: Apache/2.2.16 (Debian) PHP/5.2.6-1+lenny16
Drupal 6.24
Web File Manager 2.18
Let me know if I can provide any other details.
Thanks
Comment #12
nhck commentedmducharme, okay for you the fileinfo-extension is working ~ for aiphes it is not so that is a different case.
However mducharme, we should check why it is not getting a mimetype. You could enable devel and insert after line 3069
dpm will post a drupal message containing our details
Comment #13
nhck commentedMaybe this is related #1436442: admin user cannot access webfm_send images
Comment #14
aiphesin my case i just do a test and i've this message : essai-1.jpg has an invalid extension
so i can upload but system doesn't want my file for mime type issue...but not on all my websites..
globally they all use fckeditor and webfm...so i don't understand why it works in some cases only..
Comment #15
nhck commentedSorry but you did not understand what I was telling you. It should also say something like " It is really mimetype:" Also you need to provide debug information by devel. Maybe your servers are badly configured.
Comment #16
kidorion commentedFor what it's worth...
On our apache server mime_content_type() is returning null. I'm not an expert so I don't know why. Regardless, the webfm code should check for this rather than create an error.
So this is what I did to fix it...
At line 3057 replace..
with
Hope this helps.
Comment #17
hawthorne commentedFILEINFO_MIME_TYPE is available as of php 5.3, so on older versions of php this will not work. Using FILEINFO_MIME instead works fine.
Here's the diff, patch attached.
webfm.module line 3053:
Comment #18
nhck commentedWell hawthorne, but isn't finfo_open available before 5.3.0 either?
Comment #19
aiphesok it explain why it doesn't work on my websites running under php 5.2.10...
Comment #20
hawthorne commentednhck, the pecl package fileinfo was superseded when it was added to php 5.3. For older versions of php, install the pecl package http://pecl.php.net/package/Fileinfo usually with something like
pecl install fileinfoor in the case of a redhat flavoured systemyum install php-pecl-Fileinfoshould do the trick. I just had to do this on an older CentOS system running php 5.1.6.Comment #21
nhck commentedOkay, I commited a change:
http://drupalcode.org/project/webfm.git/commit/1c35770
Comment #22
nhck commentedDid anyone take the time to test this?
Comment #23
nhck commentedDidn't receive an complaints.