Hi Karen

My good friend just told me to take a look here and define a function
on upload_to that filters special chars from filenames.

http://docs.djangoproject.com/en/1.2/ref/models/fields/#django.db.models.FileField.upload_to

Do you aggree? Would that be the an appropriate solution to solve this
problem?

Thanks


On 13 Jun., 01:47, Karen Tracey <kmtra...@gmail.com> wrote:
> On Sat, Jun 12, 2010 at 8:37 AM, MIL <needb...@gmail.com> wrote:
> > I experience problem with special chars like æøå in filename when
> > using models.ImageField.
>
> > What am I doing wrong?
>
> > models.py
> >   picture = models.ImageField(upload_to='pics', blank=True,
> > verbose_name='Picture of you')
>
> > Using model forms
>
> > Let say I want to upload picture named "æøå.jpg"
>
> > If I do that, I get the following error msg:
> > 'ascii' codec can't encode characters in position 59-61: ordinal not
> > in range(128)
>
> > Django ver 1.2 Alpha
>
> The full traceback instead of just the error message would help people help
> you. Perhaps try 
> this:http://docs.djangoproject.com/en/1.2/howto/deployment/modpython/#if-y....
> Though that is in with the mod_python doc, it is not a mod_python specific
> problem. In general, no matter what deployment environment, your environment
> must be set to allow unicode to be passed to file functions, if you want to
> be able to manipulate files that contain non-ASCII characters.
>
> Also, you should really update to a 1.2 release level. Why are you running
> alpha?
>
> Karen
> --http://tracey.org/kmt/

-- 
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