Ask Your Question
0

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 https://github.com/openstack/horizon/.... 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
1

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
0

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

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

Seen: 214 times

Last updated: May 13 '15