It sounds like you should just embed the file's hash in the blockchain, rather than the whole file.
So you just need a method to get the hash of a file. The answer will depend on the programming language you are using, or you could access a command-line tool like sha256sum (on Linux).