Skip to content
Discussion options

You must be logged in to vote

I submitted an issue for this #909 The only ways I've seen to create a download link in pynecone are not very clean. Hopefully we'll have something like pc.download_files() or something in the future. I found a post on the pynecone discord server where someone was able to create download links like this:

@app.api.get("/download")
async def download_unmodified_video():
    # Find latest downloaded file
    file_path = max(glob.glob(f"{os.getcwd()}/downloads/**/*"))
    file_name = "unmodified_video.mp4"
    return FileResponse(path=file_path, media_type='video/mp4', filename=file_name)
.
.
.

pc.link("Download Me", href="http://localhost:8000/downloads")

I think there should be a better way.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Alek99
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants