Forums

Use API to download my files...

Trying to get a URL that will allow any enduser to just click the link and the file stored in my 'Files' tab will download.

Currently getting 401 Unauthorized when I go to the following link:

https://www.pythonanywhere.com/api/v0/user/shikharmukherji/files/path/home/shikharmukherji/splitanalysis/sheets/41515873_split_data.xls

Any help appreciated.

We do not expose your files to the internet. You need to be authenticated to PythonAnywhere in order to access your files. If you want a download, create a web app that serves the file as a static file.

Thanks a lot for the help. I was suspecting as much. Off the top of your head do you know something that will work for me? Some kind of public file storage API?

Thanks a lot for the help. I was suspecting as much. Off the top of your head do you know something that will work for me? Some kind of public file storage API?

Don't worry about it, actually. I was using Flask, so I just placed the files I needed to be downloaded in the static folder and referenced them in the HTML page via {{ url_for() }}

...which I suddenly realized is what you meant by serving it as a static file...smh.

Cool. Glad you have a solution.

Just use the web app static files feature to serve the files you want to.

can you share the code for webapp?

Which web app?