Mercurial > odfcast
view templates/convert.html @ 33:00e12392f8d4
Fix saving uploaded form file to a temporary file
The file must be saved to a temporary file for conversion via pyuno. pyuno can
only accept filenames. Also the file position must be reset to the start. If the
position is not reset we will get a IllegalArgumentException: Unsupported URL
from pyuno when converting a file without template rendering.
author | Björn Ricks <bjoern.ricks@intevation.de> |
---|---|
date | Thu, 16 Oct 2014 11:45:51 +0200 |
parents | 9d65de2ebe22 |
children |
line wrap: on
line source
{% extends 'base.html' %} {% block content %} <h1>Convert</h1> <form role="form" action="" method="POST" enctype="multipart/form-data"> <div class="form-group"> <label for="format">Format</label> <input id="format" type="text" placeholder="Format" name="format" class="form-control"> </div> <div class="form-group"> <label for="datadict">Data in JSON Format</label> <textarea id="datadict" name="datadict" class="form-control"></textarea> </div> <div class="form-group"> <label for="file" >File</label> <input id="file" type="file" name="file"> </div> <button class="btn btn-default" type="submit">Convert</button> </form> {% endblock %}