Assuming that you are doing this in Oracle environment,
here stackoverflow guys explain how to load a file into a blob with pl/sql. You may find many other sample code, just google it.
For base64 conversion oracle database has a built-in utl_encode package. I hope this will give you a head start.
Regards,
Fatih.