Closed (fixed)
Project:
FileField
Version:
4.7.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
24 Nov 2007 at 18:55 UTC
Updated:
9 Dec 2007 at 16:51 UTC
I have extensions pdf and htm as the allowable files types within my form.
If I try to upload a .htm file (eg example.htm) I get the error below.
---------------------------------------------------------------
# Files with the extension txt are not allowed. Please upload a file with an extension from the following list: pdf htm
---------------------------------------------------------------
If I then allow the txt extension, the file is then renamed to example.htm.txt.
Any advice on how to fix this issue.
Thanks in Advance
Stephen
Comments
Comment #1
jpetso commentedThis is a security measure of Drupal core, filefield has no influence on that (and shouldn't have). The file_check_upload() function in includes/file.inc appends ".txt" to certain file types. Actually, I believe that .htm files are only renamed this way in Drupal 4.7, as the corresponding check in Drupal 5 is much more stringent and doesn't cover all files that are somehow text.
Proper solution: upgrade to Drupal 5.
Quick-and-dirty solution: replace the check in file_check_upload() with the one from Drupal 5, if you know how to do it and know about the implications of modifying Drupal core.
Comment #2
spjsche commentedThanks for the quick response, I shall investigate and see which is the better option.
Thanks for your time.
Stephen
Comment #3
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.