Ask Your Question

Horizon File upload fails

asked 2015-05-13 00:24:17 -0500

I have been trying to create a dialog to upload a file leveraging the code in the CreateNamespaceForm() class at However, I noticed via PyCharm debugger that the code does not seem to remember the file that I selected.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2015-05-13 00:28:32 -0500

lhcheng gravatar image

You might have forgot to set the form attribute to multipart form. This is required whenever you use a file field.

Try adding this to your html template:

{% block form_attrs %}enctype="multipart/form-data"{% endblock %}

edit flag offensive delete link more

answered 2015-05-14 16:02:43 -0500

lhcheng, Thanks for your response, your suggestion did help fix the issue I was seeing.

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2015-05-13 00:24:17 -0500

Seen: 311 times

Last updated: May 13 '15