Upload files from the command line
Bourne out of the frustration having to come out of a terminal window in order to upload a file shunt.io is the easiest way to upload a file from the command line.
No complicated software or apis and code to remember all you need is the simple but useful cURL package.
Running Debian?
1 |
apt-get install curl |
Do a web search to find out how to install it for your OS.
Got cURL? Get uploading!
1 |
$ curl -u user:pass -F 'file=@/path/file.name' https://shunt.io |
Do cool stuff
List files
1 2 3 4 5 6 7 |
$ curl -L -u user:pass https://shunt.io/files/username +-----------+----------+--------------------------+--------------------------+----------------------------------+ | Name | Size | Type | Location | Share Key | +-----------+----------+--------------------------+------------------------+------------------------------------+ | file.name | 845941 | image/jpeg | files/username/file.name | - | +-----------+----------+--------------------------+--------------------------+----------------------------------+ Found 1 file(s). |
Share a file
1 2 |
$ curl -X POST -u user:pass https://shunt.io/files/user/file.name -d share=yes shunt.io/view/username/file.name?share=3afe705bd8c24ffc6f39fe2e75e0fe6c |
The string returned after ‘share=’ is unique to the specific file. If you list your files again this key will be displayed in the ‘Share Key’ column. To download enter into a browser or
1 |
$ curl -O https://www.shunt.io/files/username/file.name?share=3afe705bd8c24ffc6f39fe2e75e0fe6c |
Unshare a file
1 2 3 |
$ curl -X POST -u user:pass https://shunt.io/files/user/file.name -d share=no Sharing has been disabled |
If you list your files again the key will have been deleted from the ‘Shared Key’ column.
Delete a file
1 2 |
$ curl -X DELETE -u user:pass https://shunt.io/files/username/file.name File deleted |
Download a file
1 |
$ curl -u user:pass https://shunt.io/username/file.name -O |
Want to download via a browser? You can do that too, open https://shunt.io/username/file.name enter your user credentials and VOILA!