I am currently uploading images pasted from the clipboard with the following code:
// Turns out getAsFile will return a blob, not a file var blob = event.cli
Are you using Google App Engine? You could use cookies (made with JavaScript) to maintain a relationship between filenames and the name received from the server.