By jihanj on
I'm uploading a bunch of files with the upload module. Everything went smoothly until I tried to upload a compressed file with a .tar.gz file. The upload itself was successful but I get this message upon finishing:
"For security reasons, your upload has been renamed to test.tar_.gz."
The original file name was test.tar.gz but Drupal somehow thought it was a security risk and went ahead and renamed it for me. (It added an underscore after 'tar'.) I tried other .tar.gz files but had the same result.
Could I override this behavior without resorting to modifying upload module?
Comments
Shortly after posting the
Shortly after posting the above inquiry, I found my own solution. I DID look into the php scripts in hope of figuring out what's going on.
It turns out the error message was generated by a function named file_munge_filename() located in file.inc. Basically what it does is when there is a string whithin a file name that resembles a file extension that is not allowed, an underscore will be added.
I solved the problem by going to administer->site configuration->file updates and then adding tar to the list of permitted extensions.
Same problem solve in Drupal7
Hi,
me problem was revolved adding 'tar' extension in allowed file extension of my content file field.
Thanks.