This a file sharing API application, Users can upload a file and it creates a random URL which they can share. The current version supports file upload upto 3GB. It will allow anyone with this URL to download the uploaded file. No need to Sign Up, easy free file sharing service.
Link to Live Website: https://www.datafileshare.com/
Any copyright Files uploaded will be users responsibility.
# Please make sure to update the .env file before starting the project
# Execute the project using nodemon
npm run dev
#Excute the project without nodemon
npm run start
If the user Signs Up for an account, the person who needs to download the file should also sign up in order to access the file.
Remove the .example extension to the file to create the .env file.
DATABASE_URL=youre_DB_URL_from_MONOGO
PORT = youre_PORT_number
ACCESS_TOKEN_SECRET = scecretkeyhere
ACCESS_TOKEN_LIFE = 2m
REFRESH_TOKEN_SECRET = scecretkeyhere
REFRESH_TOKEN_LIFE = 2m
SESSION_KEY = scecretkeyhere
NODEMAILER_USER = smtp_username
NODEMAILER_PASSWORD = smtp_password
NODEMAILER_HOST = smtp_hostname
EMAIL_HOSTNAME = domain_name
Example for download: localhost:1337/signUpAPI
"email" should be provided as a JSON form in body in raw format
"password" should be provided as a JSON form in body in raw format
"confirmPassword" should be provided as a JSON form in body in raw format
Example for download: localhost:1337/loginAPI
"email" should be provided as a JSON form in body in raw format
"password" should be provided as a JSON form in body in raw format
Example for Upload: localhost:1337/uploadAPI
Also include a form in the API add a file with name "upload" and select the File
If you need to sepicfy expiry time add a new field "urlExpiryTime" - specify hours.
If no expiry time is specified by default it will be expiring after 1 hour.
Example for download: localhost:1337/shareFileAPI/:fileCode/:emailID
"fileCode" the shortcode which you recieved when you uploaded the file
"emailID" the E-mail ID of the user to whom you would like to share the file with (The other user should have an account to access this).
Example for download: localhost:1337/downloadAPI/shortCode
"Shortcode" will be provided once the file is uploaded.
Example for download: localhost:1337/deleteAPI/shortCode
Replace shortcode with the value recived when you uploaded the file.
A Cron Job runs every minute to delete expired files and data from MongoDB. This ensures that no files are left behind in the server after the expiry time.
Encrypt the uploaded files! Use CDN ot Amazon S3 storage to upload files