user426795
user426795

Reputation: 11663

Upload a file using django model issue

file_name = models.FileField(upload_to=settings.PATH, verbose_name=_('Upload_Path'), \
                                null=True, blank=True, help_text=' .zip file only')

When I rendring this field using forms it Shows me button <input type="file" name="file" id="id_file"> and beside this button No file chosen text come.

When I upload any document suppose foo.zip The No file chosen remains there and foo.zip just overwrite it. Ideally No file chosen should be removed. What may be the reason?

If jquery can help me to solve this problem then it is ok.

Upvotes: 0

Views: 313

Answers (1)

Abdul Kader
Abdul Kader

Reputation: 5842

It depends upon the browser you are using. Jquery has nothing to do with it.. Django forms just create a file field. Browser displays the file open dialog and added file in their own style. This has nothing to do with your code.

Upvotes: 1

Related Questions