HTML5 upload logic without UI