Skip to content

Commit

Permalink
Fix file uploading
Browse files Browse the repository at this point in the history
  • Loading branch information
aphistic committed Apr 10, 2016
1 parent 62221d6 commit eb8e944
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion copilot/file_server.py
Expand Up @@ -74,7 +74,7 @@ def home():
web_path = request.args.get('path') or ''
if request.method == 'POST':
if request.form['action'] == 'create':
f = request.files['file']
f = request.files['upfile']
if f:
fname = secure_filename(f.filename)
fpath = os.path.join(app.config['ROOT_PATH'], web_path, fname)
Expand Down
5 changes: 3 additions & 2 deletions copilot/templates/home.html
Expand Up @@ -36,8 +36,9 @@ <h1>Files</h1>
{{ name }} [<a href="#" onclick="removeFile('{{ name }}'); return false;">X</a>]<br>
{% endfor %}
<br>
<form action="?path={{ current_dir }}" method="post" enctype="multipart/form-data">
<input type="file" name="file">
<form id="addfile" action="/?path={{ current_dir }}" method="POST" enctype="multipart/form-data">
<input type="hidden" name="action" value="create">
<input type="file" id="upfile" name="upfile">
<input type="submit" value="Upload">
</form>
<form id="remfile" action="/?path={{ current_dir }}" method="post">
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Expand Up @@ -2,12 +2,12 @@
setup(
name = 'copilot',
packages = ['copilot'],
version = '0.1.6',
version = '0.1.7',
description = 'Application to manage files on external USB drives',
author = 'Erik Davidson',
author_email = 'erik@erikd.org',
url = 'https://github.com/aphistic/copilot',
download_url = 'https://github.com/aphistic/copilot/tarball/0.1.6',
download_url = 'https://github.com/aphistic/copilot/tarball/0.1.7',
keywords = ['raspberrypi', 'raspberry', 'pi', 'filemanager'],
classifiers = [],
install_requires = [
Expand Down

0 comments on commit eb8e944

Please sign in to comment.