G'day.

I would like to change the type of file extensions that are permitted to be uploaded, especially .zip files. I have tried adding .zip to the default list using Administer>Site configuration>File Uploads but with no success. Then I tried changing the hardcoded whitelists in the upload.module and fileshare.module but still no success.

a) Are there any other modules responsible for filtering file extensions?
b) Any suggestions on how to allow any file types that I want?

Thanks.

Drupal 5.1
PHP 5.1.2
Apache 2.0.55
Ubuntu 6.01

Comments

dpauld’s picture

to be clearer...when I tried to upload files with .zip extension, I get the error message:

The selected file filename.zip 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 htm doc xls pdf ppt pps ai psd odt odg.

benjaminlhaas’s picture

Go to "Administer -> Site Configuration -> File Uploads," add 'zip' to the "Default permitted file extensions:" section, and click on "Save configuration."

benjaminlhaas’s picture

whoops, didn't read your original post carefully enough. did you omit the dot when adding 'zip' to the list?

dpauld’s picture

when trying to add new file extensions to the permitted list using Adminstration>Site Configuration>Upload files.

But no joy.

Oddly enough, even though I have added 'zip' as a permitted file extension, when I get the error message after trying to upload a zip file, the listing of all the permitted file extensions doesn't include 'zip' .

Error message:
"The selected file filename.zip 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 htm doc xls pdf ppt pps ai psd odt odg."

Is there file extension checking done in other modules or includes?

herko’s picture

Hello,

I am facing the same issue: I can't seem to add an allowed file extension to the fileshare module. The extensions for the rest of the site work properly, as set in the file uploads admin section. I set the correct extensions for all groups, and they work for the attachments on the site. But the fileshare module seems to have a mind of its own concering this. We use Drupal 5.3, fileshare 5.x-1.0. Any tips?

Herko

innovationcreation’s picture

Hi,

In 4.7 I added to /admin/settings/upload the file extensions
js zip jpg jpeg gif png txt html doc xls pdf ppt pps

with no dots

Zip files attach fine.
js files get attached but drupal adds .txt to the end so the file name is
player.js.txt

No error or warning, drupal just does it.

what module is adding the .txt to the end of js extensioned files?
Thanks in advance,
John Blue
innovationcreation@gmail.com

adam.skinner’s picture

This was bothering me as well. It is happening in file_save_upload.

jruberto’s picture

I am actually interested in allowing uploads of all file types and have not been able to accomplish it via the admin interface. Is it possible to configure the extension filter to accept any extension? Thanks!!!

===============
Jim Ruberto
The Geek Gene
jim@geekgene.com

SourceTree Commons

hgmichna’s picture

Has it not occurred to anyone that those "Default permitted file extensions" are nothing but a nuisance and a pain? Since everybody has to allow ZIP files, everybody can upload anything anyway.

What I could understand is if certain extensions like EXE, COM, VBS were prohibited, but having a list of allowed extensions is a nonsense.

Any solution, workaround, patch is welcome.

Hans-Georg

blueflowers’s picture

IMHO it would be much better to have a list of 'non-allowed file types', this seems to make much more sense to me.

Case in point:

We are allowing for video uploading. Well look at the possible list of extensions to add:

3g2 3gp 3gp2 3gpp 3mm 60d aep ajp amv asf asx avb avi avs bik bix box byu camrec cvc d2v d3v dat dce dif dir divx dmb dpg dv dvr-ms dvx dxr eye fcp flc fli flv flx gl grasp gvi gvp ifo imovieproj imovieproject ivf ivs izz izzy lsf lsx m1pg m1v m21 m2v m4e m4u m4v mjp mkv mod moov mov movie mp21 mp4 mpe mpeg mpg mpv2 mqv msh mswmm mvb mvc nsv nvc ogm pds piv playlist pro prproj prx qt qtch qtz rm rmvb rp rts rum sbk scm scn sfvidcap smil smk smv spl srt ssm str svi swf swi tda3mt tivo ts vdo veg vf vfw vid viewlet viv vivo vob vp6 vp7 vro w32 wcp wm wmd wmv wmx wvx yuv zmv

With the form textfield only allowing 255 characters, it gets cut off around 'M'

Fourth Wall Media
Toronto, Canada

natcha’s picture

I had the same problem and resolve it after many days searching... my problem was on fact a stupid one:

I haven't even seen that there is a "Settings for authenticated user" collapsed fieldset, just below the "General settings"... When changing the values in this one it works perfectly.
It's under Administer > Site configuration > File uploads

Hope this help :)

winthropite’s picture

I wanted to let everyone know I had this same issue and after playing around I solved it. See here: http://drupal.org/node/1350812