On Thu, Oct 30, 2008 at 10:52 AM, [EMAIL PROTECTED] <
[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> I've having a problem with FileField and ImageField. Basically, I have
> a form for uploading images:
>
> Name: _a_ (throws ValidationError('This name is already taken. Choose
> another'))
> Notes: _test notes_
> Filename: _abc123.txt_
>
> When I press SUBMIT, I get the form again, but it looks like this:
>
> -This name is already taken. Choose another
> Name: _a_
> Notes: _test notes_
> Filename: _________ (blank???? Not sure why)
>
> The FileField is not repopulated for some reason, but the other fields
> are.
>
I believe this is a browser security measure. The browser won't allow a
server to pre-load a value into a File input, because that would mean a
naive user could easily submit a form which uploads some key file from their
machine to the server. So for a File input the browser requires that the
user actually go and select a file to upload. (I do not know if there are
any tricks one can play to get around this, I've never looked for one.)
Karen
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---