Dimitri: I assume that you want to modify the name of the file that is
submitted. It can be done in _save_FIELD_file of the model. Here is a
snippet that i use to change the name of the uploaded avatar icon for
the user.

        def _save_FIELD_file(self, field, filename, raw_contents, save=True):
                img_name = self.get_profphoto_filename()
                #if there is already an avatar, then delete it
                if os.path.exists(img_name):
                        os.remove(img_name)
                (name,ext) = os.path.splitext(filename)
                filename = "%s%s" % (self.user,ext)

                super(userprofile, self)._save_FIELD_file(field, filename,
raw_contents, save)

for further ref, you may want to read:
http://gulopine.gamemusic.org/2007/nov/07/customizing-filenames-without-patching/

hope this helps.

regards,
Joseph

On Mar 31, 9:22 pm, Dmitriy Sodrianov <[EMAIL PROTECTED]> wrote:
> Hi to all!
>
> I'm stuck with the problem of manipulating request.FILES. I need to do
> the following thing - there is a form with the FileField in it, After
> the submit file that is send with the form must be renamed and stored
> in particular way, let's say md5 of client ID.
>
> I have no idea of how to do the task.
>
> Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to