+1  A: 
name = models.FileField(upload_to=get_absolute_url, max_length=255)

upload_to usually looks like this

upload_to ='./files'

It will be stored as ./files/your.file in the db and as <MEDIA_ROOT>/files/your.file at your disk

You can change the upload_to-String to whatever fits best for you programatically

upload_to ='./files'+'/subdir'

but it should start with './'

FileField-Reference

get_absolute_url() should return a url like http://domain.com/sitemedia/files/your.file

EDIT:

to remove the path from the file name you could do string operations in File.save() like

def save(self, force_insert=False, force_update=False):
    self.name = self.name[self.name.rfind('/')+1:]
    super(File, self).save(force_insert, force_update)
vikingosegundo
I don't understand, how is that different from my code? It still stores the whole './files/your.file' in the database instead of just 'your.file'.
RommeDeSerieux
Sorry, this is not my day... I undestood u got an absolute path like /home/www/...
vikingosegundo
please see my edit
vikingosegundo