XMLHttpRequest upload with callback