changed it to use exported APIs instead of internal functions where possible.
Attach a file by drag & drop or click to upload