Python Flask Help - How Can I Solve This. - Programming - Nairaland
Nairaland Forum › Science/Technology › Programming › Python Flask Help - How Can I Solve This. (762 Views)
| Python Flask Help - How Can I Solve This. by fnep2smooth(op): 4:39pm On Jan 16, 2021*. Modified: 7:33pm On Jan 24, 2021 |
I have this YouTube channel am managing and I am creating a web app with flask to automatic download the audio of the video in my channel. In my code I use moviepy to extract the video and also convert it to audio. Now my challenge is after the download and moving it to the specific folder, I return a download.html template to show a download link button but I can be able to create get the link. I also try to out put the download to my browser as an attachment through send_file but it's not working. The attachment will download but only on the terminal I want to push it to the browser , please any help UPDATE The first image was the reason i created this thread, before then i was having issue with existing file after coveting and trying to move it to the specific folder i want. this require me to delete the file existing attachment before running the code, so i used shutil.move to overwrite the existing file which you can see in the second image.... but still can download the attachment Code below.
|
| Re: Python Flask Help - How Can I Solve This. by Karleb(m): 7:15pm On Jan 18, 2021 |
Have you been able to solve this? From what I'm seeing, you are only rendering the view you are not sending any data to it. I don't write flask but I think the return should be like. return render_template('promote. html').with('attachment.file') |
| Re: Python Flask Help - How Can I Solve This. by kensmoney(m): 11:09am On Jan 19, 2021 |
Put the attachment in ur return statement, then in ur front end, use "jinja2 template engine" to render the attachment |
| Re: Python Flask Help - How Can I Solve This. by fnep2smooth(op): 5:19pm On Jan 24, 2021 |
Karleb:An just seeing your message now... Let me update the new error |
| Re: Python Flask Help - How Can I Solve This. by fnep2smooth(op): 7:39pm On Jan 24, 2021 |
UPDATE The first image was the reason i created this thread, before then i was having issue with existing file after coveting and trying to move it to the specific folder i want. this require me to delete the file existing attachment before running the code, so i used shutil.move to overwrite the existing file which you can see in the second image.... |
Can You Solve This Google Coding Interview Problem? (pics) • Django And Flask Users, Your Help Is Needed Please • How To Access Pulseway Restful API Using Python Flask • 2 • 3 • 4
Download Online Job Portal Using PHP With Source Code • Cost Effective Android Application Development Services • Java