hi,

i'm trying to attach a tar.bz2 file to a node, but can't properly do so as drupal would rename the thing to test.tar_.bz2. i have tar.bz2 sitting in the permitted file extensions settings at admin/settings/uploads.

cheers,
nico

Comments

Jean-Philippe Fleury’s picture

Subscribing, and confirming on Drupal 6.10.

dave reid’s picture

Have you just added 'bz2' as an allowed extension?

Jean-Philippe Fleury’s picture

Yes, only bz2, and my files are renamed file.tar_.bz2

Same bug if I put tar.bz2 as allowed extension.

As a workaround, I change file's extension to tbz2, e.g. file.tbz2, so my files aren't renamed.

nschloe’s picture

Same effects here, same workaround in use.

flaviovs’s picture

This is really an issue.

File names with URL in names are also affected. I.e. try do upload "www.example.com - foobar.pdf" and see your file renamed to "www.example._com - foobar.pdf". Not nice.

I understand what this feature is trying to avoid. My question is: is such ".com" (for example) so dangerous that it have to be munged? Doesn't it suffice to check for extensions at the end of file names (that's the definition of "file extension" anyway)?

Also see http://drupal.org/node/285827 for another workaround. Unfortunately it's not a good solution for all cases -- e.g. I think that allowing uploaded files with a ".com" extension, for example, is not a good idea.

nschloe’s picture

Version: 6.6 » 6.16

Status: Active » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.