Compare commits

..

3 commits

Author SHA1 Message Date
j
1d5fdf35ec # in pdf name not working 2019-08-19 22:28:52 +02:00
j
c5d481ee78 move client_max_body_size 2019-08-19 22:28:35 +02:00
j
65012d34ee use python3 2019-08-19 11:27:11 +02:00
6 changed files with 10 additions and 5 deletions

View file

@ -55,11 +55,11 @@ server {
proxy_buffering off; proxy_buffering off;
proxy_read_timeout 90; #should be in sync with gunicorn timeout proxy_read_timeout 90; #should be in sync with gunicorn timeout
proxy_connect_timeout 90; #should be in sync with gunicorn timeout proxy_connect_timeout 90; #should be in sync with gunicorn timeout
client_max_body_size 32m;
if (!-f $request_filename) { if (!-f $request_filename) {
proxy_pass http://127.0.0.1:2620; proxy_pass http://127.0.0.1:2620;
break; break;
} }
client_max_body_size 32m;
} }
error_page 400 /; error_page 400 /;

View file

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
import os import os
import signal import signal
import sys import sys

View file

@ -66,7 +66,7 @@ pandora.ui.document = function() {
? pandora.user.ui.documents[item.id].position ? pandora.user.ui.documents[item.id].position
: 1, : 1,
url: '/documents/' + item.id + '/' url: '/documents/' + item.id + '/'
+ item.title.replace('?', '_') + '.' + item.extension, + pandora.safePDFName(item.title + '.' + item.extension),
width: that.width(), width: that.width(),
zoom: 'fit' zoom: 'fit'
}) })

View file

@ -196,7 +196,7 @@ pandora.ui.documentDialog = function(options) {
? pandora.user.ui.documents[item.id].position ? pandora.user.ui.documents[item.id].position
: 1, : 1,
url: '/documents/' + item.id + '/' url: '/documents/' + item.id + '/'
+ item.title.replace('?', '_') + '.' + item.extension, + pandora.safePDFName(item.title + '.' + item.extension),
width: dialogWidth, width: dialogWidth,
zoom: 'fit' zoom: 'fit'
}) })

View file

@ -2625,6 +2625,11 @@ pandora.openURL = function(url) {
} }
}; };
pandora.safePDFName = function(name) {
name = name.replace('?', '_').replace('#', '_');
return name;
};
pandora.saveURL = function(url, name) { pandora.saveURL = function(url, name) {
var link = document.createElement('a'); var link = document.createElement('a');
if (typeof link.download === 'string') { if (typeof link.download === 'string') {

View file

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
from __future__ import print_function from __future__ import print_function
import json import json
import os import os