On Mon, Aug 23, 2010 at 4:14 AM, josephi <jose...@dircsa.org.au> wrote:

> Hi, I have a suspicion that my problem might not be Django specific,
> but I'm not entirely sure, and would appreciate any pointers to
> information on the subject.
>
> I have a Form with several fields, one of which is a FileField. This
> field is required. If I fill in the FileField but the form doesn't
> validate because of other field errors the FileField widget becomes
> empty once the form is redisplayed after validation. This forces the
> user to re-select their file.
>
> Can anyone tell me the reason for this? Is there a workaround?
>

The reason is because typically browsers don't allow the web server to
pre-fill a file input with a value. (Allowing this would enable malicious
servers to easily trick naive users into uploading sensitive files.)

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