upload - files upload service in golang.
Useful if you want to send big files to others and common mail servers don't accept files over a standard length (usually a few MB).
- Using
- Compile. See here how.
- Copy
upload
folder in your account on your Ubuntu machine. - Run
./upload
file from upload folder. - Open http://localhost:8080 in browser. Replace localhost with server ip if you access upload service from another computer. If you are behind a router remember to forward 8080 port. Change this port as needed.
- Use user and password from
secrets
file. Change this file as needed. - Upload a file and send received link to others for download.
Files are transfered in /files folder.
Automaticaly start service by adding in /etc/rc.local
sudo nano /etc/rc.local
and add following line before exit
/home/user/cws/upload/upload &
Use cron to keep server clean
crontab -e
and add following line to clean files older than 24h
MAILTO=""
* * * * * find /home/george/src/github.com/geosoft1/upload/files/* -mtime +1 -exec rm {} \;
Clear MAILTO to avoid sending mails to root if no files to delete. Feel free to use any location.
No root rights are required.