I want to add file size limitation when add file to ipfs

From @beyonderyue on Wed May 10 2017 08:56:16 GMT+0000 (UTC)

I want to add file size limitation when add file to ipfs, such as if the file size is over 1Mb, can’t add to ipfs.
How I can do this?

Thanks a lot

Copied from original issue: https://github.com/ipfs/faq/issues/256

Slightly related to my topic here:

As I and @Kubuxu wrote there, you can always do certain things outside of IPFS, e.g. split a file to obscure or simply reduce file size, or check the file size first before adding to the IPFS (or not adding if too big). This can be done in a simple shell script.