Rewrite the upload hidden service in Flask