zallarak
zallarak

Reputation: 5515

Django File Uploads using path

If I upload a file to my website via Ajax, and I have the path of it, is there a way I could submit this path to a Django form's built-in FileField?

Upvotes: 0

Views: 260

Answers (1)

ilvar
ilvar

Reputation: 5841

I think you can construct a UploadedFile instance from file-like object, put it into dict {'name': temporary_uploaded_file} and provide it to form's files argument. Haven't tried it myself but should be working.

Upvotes: 1

Related Questions