added support to pass base64 string instead of file