Return link page to avoid auto-downloads
This commit is contained in:
parent
b15ae0e47d
commit
2a244fca30
4
run.py
4
run.py
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
from flask import Flask, Response, request, redirect, url_for, send_from_directory, abort, render_template
|
||||
from flask import Flask, request, redirect, url_for, send_from_directory, abort, render_template
|
||||
from werkzeug import secure_filename
|
||||
from threading import Thread
|
||||
import logging
|
||||
|
@ -95,7 +95,7 @@ def upload_file():
|
|||
|
||||
try:
|
||||
if request.form["source"] == "web":
|
||||
return redirect(url_for('get_file', filename=filename), code=302)
|
||||
return render_template('link.html', data=data, page=config["SITE_DATA"])
|
||||
except Exception:
|
||||
return json.dumps(data)
|
||||
else:
|
||||
|
|
|
@ -63,12 +63,12 @@ body {
|
|||
animation: rise 1s ease-out;
|
||||
}
|
||||
|
||||
.links li a {
|
||||
.links li a, .fileLink {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.links li a:hover {
|
||||
.links li a:hover, .fileLink {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
{% extends "shell.html" %}
|
||||
{% block body %}
|
||||
<h1 class="title">
|
||||
Here's your link:
|
||||
</h1>
|
||||
<p style="text-align: center;">
|
||||
<a class="fileLink" href="{{ data.url }}">{{ data.url }}</a>
|
||||
</p>
|
||||
{% endblock %}
|
Loading…
Reference in New Issue