Dear,
I have  a Class that allows to upload Media Files

DEFAULT_UPLOAD_SUBFOLDER = 'upload/%Y/%m/%d'
# For the time being, the value is set to a real absolute max 200 Gb
ABSOLUTE_MAX_SIZE = 200 * 1024 * 1000 * 1024 * 1024

class Media(models.Model):
    """ Model for any file (image, pdf, MS-document) """
    media_file = models.FileField(upload_to=DEFAULT_UPLOAD_SUBFOLDER,
                                  max_length=ABSOLUTE_MAX_SIZE)
    ...

When posting a file via the Form :
class MediaForm(forms.ModelForm):

    class Meta:
        model = Media
    ...

Every thing goes fine but for the fact that I don't know the exact
file name.

tsm...@calvin:~/Documents/python/gramps/trunk/src/web/upload/
2010/01/08$ ls -la
total 20
drwxr-xr-x 2 tsmets tsmets 4096 2010-01-09 02:07 .
drwxr-xr-x 3 tsmets tsmets 4096 2010-01-08 14:53 ..
-rwxr-xr-x 1 tsmets tsmets  856 2010-01-09 02:07 Test_1__.pdf
-rwxr-xr-x 1 tsmets tsmets  856 2010-01-08 14:55 Test_1_.pdf
-rwxr-xr-x 1 tsmets tsmets  856 2010-01-08 14:53 Test_1.pdf

I however want to process that file and upon correct processing move
it to another folder.
Due to the fact that the folder is named : 'upload/%Y/%m/%d', I would
not like to reconstruct the folder directory name myself.

Can someone help .. ?

\T,
-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.


Reply via email to