A while ago, we have written a guide about [**Transfer.sh**][1] which allows you to share files over Internet from command-line. Today, we will see yet another file sharing utility called **Anypaste**. It is a simple script to share and upload files to compatible hosting sites depending upon the type of the files, automatically. You don 't need to manually log in to the hosting sites and upload or share your files. Anypaste will **pick the right hosting sites depends upon the type of the file** you want to upload. To put this simply, photos will get uploaded to image hosting sites, videos to video sites, code to pastebins. Cool, yeah? Anypaste is completely free, open source and light-weight script and you can do everything from command line. You don't need to depend on any heavy, memory-consuming GUI apps to upload and share files.
### Anypaste - Share And Upload Files To Compatible Hosting Sites Automatically
#### Installation
Like I already said, it's just a script. So, there won't be any complex installation steps. Just download it somewhere where you can run it, for example /usr/bin/anypaste, make it as executable and start using it in no time. Alternatively, you can run the following two commands to quickly install Anypaste.
That's it. To update the old Anypaste version, just overwrite the old executable file with new one.
Now, let us see some practical examples.
#### Configuration
Anypaste will work just out of the box. No special configuration is required! The default configuration file is **~/.config/anypaste.conf** and it will be automatically created when you run Anypaste for the first time.
The only required configuration option is **ap_plugins**. Anypaste uses plugin system to upload files. Each hosting (upload) site is represented by a specific plugin. You can view the list of enabled plugins under **ap-plugins directive** in anypaste.conf file.
```
# List of plugins
# If there are multiple compatible plugins, precedence is determined
# by which one is listed first in this array
ap_plugins=(
# Videos/Gifs
'sendvid' 'streamable' 'gfycat'
# Images
'tinyimg' 'vgyme'
# Audio
'instaudio'
# Text
'hastebin' 'ixio' 'sprunge'
# Documents
'docdroid'
# Any file
'jirafeau' 'fileio'
)
[...]
```
If you install a new plugin, add it to this list. If you want to disable a default plugin, just remove it! If multiple plugins are compatible, the first one in the array is selected, so **order matters**.
#### Usage
To upload a single file, for example test.png, run:
As you can see in the above output, Anypaste has automatically found the compatible hosting site (https://tinyimg.io) to the given image file **test.png** and uploaded into it. Also, it gave us the direct link to view/download the uploaded file.
Not just .png files, you can upload any other image file types. For example, the following command will upload file.gif:
```
$ anypaste file.gif
Current file: file.gif
Plugin 'streamable' is compatible, but missing config parameters: 'streamable_email' 'streamable_password'
You can set them in /home/sk/.config/anypaste.conf
Anypaste has automatically found the compatible hosting sites to both files and uploaded them successfully.
As you may noticed in above examples in the usage section, Anypaste has picked the "best" plugin automatically. Also, you can upload files with a specific plugin. For instance, to upload files to **gfycat** site, run:
```
anypaste -p gfycat file.gif
```
Sample output:
```
Current file: file.gif
Plugin 'streamable' is compatible, but missing config parameters: 'streamable_email' 'streamable_password'
You can set them in /home/sk/.config/anypaste.conf
As you see, Anypaste first asked me to determine plugins automatically. I don't want it to find plugins automatically, so I answered "No". Then, it listed the available plugins and asked me to pick one from the list. Similarly, you can upload and share files of different types. The given files will uploaded to the compatible sites.
Whenever you try to upload a video file, it will uploaded to the any one of following sites:
1. sendvid
2. streamable
3. gfycat
Here note the order. Anypaste will first try to upload the file to sendvid site. If there is no plugin for sendvid, it will try the other two sites in the given order. Of course, you can change this in the config file.
Images will be uploaded to:
1. tinyimg.io
2. vgy.me
Audio files will uploaded to:
1. instaud
Text files will uploaded to:
1. hastebin
2. ix.io
3. sprunge.us
Documents will be uploaded to:
1. docdroid
Any other files will uploaded to:
1. jirafeau
2. file.io
Some of the above listed sites will delete the contents after a particular period of time. So, check the those website's terms and conditions before uploading and sharing contents.
Recommended Read:
#### Conclusion
In my opinion, the idea of file identification to determine where to upload the files is really brilliant, and the developer has perfectly used it in the right way. Anypaste will definitely be useful to everyone who share files frequently over Internet. I hope you will find it useful too.
And, that's all for now. More good stuffs to come.