title: Django: how to stop Django from altering filenames (e.g. transforming a space into a _ )?
body: <p>I'm working on a little Django project and I have a filefield in my models.py.
  Everything works fine, but I don't like that Django is editing the filenames after upload. It changes spaces into underscores and it removes (square) brackets and stuff like that.</p>
  
  <p>Is there any way to stop Django from doing this?
  I can see that it is to make the website safer, more secure and also just avoid errors. But, I'm the only one who's going to be able to upload files anyway.</p>
  
  <p>Hopefully someone knows if (and how) this is possible :)</p>
  
  <p>Thanks!</p>
  
  <p>edit:</p>
  
  <p>Here's the FileField in the models.py:</p>
  
  <pre><code>file = models.FileField(upload_to=file_path)
  </code></pre>
  
  <p>Here's my upload_to:</p>
  
  <pre><code>def file_path(instance, filename):
      extension = filename.split('.')[-1]
      new_filename = '%s - %s.%s' % (str(instance.model.object_number), str(instance.model.object_name), str(extension))
      return '/'.join(['files', str(instance.model.object_theme), str(instance.model.object_number), new_filename])
  </code></pre>