fix non-chunked uploads and improve extension handling