Django - forms.FileField() initial value

后端 未结 2 557
鱼传尺愫
鱼传尺愫 2020-12-06 10:55

Is it possible to give initial value for forms.FileField() dynamically?

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-06 11:30

    By security standards, can't have a default value and it can't be manipulated.

    The reason is, that a hacker can set the default value of the file input to any important file on your system (containing passwords, certificates and so on), hide this field using CSS and you will never know that you have uploaded something to hackers host.

提交回复
热议问题