added a very simple receiver that can handle POST requests similar to 0x0
This commit is contained in:
parent
840e0e767b
commit
5c9efaadb4
|
@ -3,6 +3,7 @@ A very simple python script that aims to replace the most basic functionalities
|
|||
This wouldn't be necessary if ShareX had just been developed as a cross-platform project, but I digress.
|
||||
Needless to say, this is being developed for and tested on Linux. If you're on Windows, just use ShareX.\
|
||||
Only (s)ftp uploads for now, but I might add simple curl commands (like used by 0x0) later on.
|
||||
I should add that the focus will be on a self-hosted server. If you don't care about that, just `curl` 0x0.st or something.
|
||||
#### What works:
|
||||
- Taking area screenshots
|
||||
- Uploading screenshots to (s)ftp
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
# this file can be run on a server to act as the endpoint of the script.
|
||||
# I mainly want to test whether this is faster than sftp
|
||||
|
||||
from flask import Flask, request
|
||||
from werkzeug.utils import secure_filename
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
@app.route('/', methods=['POST'])
|
||||
def receive_file() -> tuple:
|
||||
if 'file' in request.files:
|
||||
file = request.files.get('file')
|
||||
filename = secure_filename(file.filename)
|
||||
file.save(filename)
|
||||
return filename, 201
|
||||
return 'you\'re doing this wrong', 418
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run(ssl_context='adhoc')
|
Loading…
Reference in New Issue
Block a user