Fix file upload, make download synchronous