A over-complicated and buggy filehoster that uses mongodb
Set the following Environmental Vars:
db
- Your MongoDB URL
adminuser
- Your admin username, will be explained later
adminpass
- Your admin username, will be explained later
Install requirements using the following command in terminal:
python3 -m pip install -r requirements.txt --user
Start the service:
python3 -m filehoster
Press the run on repl
badge at the top of the README.md
Then in repl.it create a .env with the following details:
db = MongoDB-link
adminuser = YourAdminUsername
adminpass = YourAdminPassword
None of these should be in ""
This is where you will be able to upload files through the UI
Here you will directed to a page where you can input your filename you have upload and be redirected to the download link
Simply replace <filename> with a filename of that has been uploaded
This is a simple api that can receive a file that has been sent. This must be sent in the request argument "files" and the in the format of file=file
or {"file": file}
.
Then you will receive a json in the format of:
{'success': True or False, 'error': ErrorType}
This is where adminuser
and adminpass
will be explained!
If the user and pass is not the same as the adminusername and adminpassword it will throw a 405 Forbidden HTTP Error.
This gives you the right to delete files that has been stored on your database.