The upload action should result at the same result as a manual upload action - you should see the file in the compose panel.
2 possible ways I know of doing it -
1. simulate drag&drop event with a BLOB in the compose panel itself (Gmail lets you upload a file using drag&drop).
2. make an ajax call to the upload service
a third alternative is more than welcome.