Hi all im new to FastAPI and im looking for a way to save excel files that are hosted on some server.
What I have currently is something like this and I can use that in FastApi function but I don't think that this is the best way to handle this.
import shutil
import urllib.request
from contextlib import closing
with closing(urllib.request.urlopen('ftp://server/path/to/file')) as r:
with open('file', 'wb') as f:
shutil.copyfileobj(r, f)
What i want to do is to pass some URL that leads directly to excel file on a server into API endpoint and i want to save it/open it