Data: URI Scheme

The data: URI scheme is a nifty way to include files for download as I did here without having to mess with attachments or file hosting. Encoding the payload is just a one-liner.

cat file.txt | perl -MURI::Encode -e "print URI::Encode::uri_encode(join('',<STDIN>))" > link.txt

There are also websites like this one that will do the encoding, for the command-line shy.

Advertisements
This entry was posted in perl, web. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s