Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
160 views
in Technique[技术] by (71.8m points)

html - Python Flask download button example?

Do you have any other method to download file from button. Because i need stylish download button. i wanna change background color and font so on...

i only have this one:

in Flask:

return send_from_directory(directory=uploads, filename=fiiilename)

in HTML:

<center>
<p class="big">
<ul>
<a href="{{ url_for('download', filename=fiiilename) }}" style="color:#000000;">
<b>Click Download msword</b>
</a>
</ul>
</p>
</center>

also this one is not working in my code: https://pypi.org/project/flask-download-btn/

question from:https://stackoverflow.com/questions/65623741/python-flask-download-button-example

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

i found answer:

<!DOCTYPE html>
<html>
  <head>
    <title>Title of the document</title>
    <style>
      .button {
        display: inline-block;
        padding: 10px 20px;
        text-align: center;
        text-decoration: none;
        color: #ffffff;
        background-color: #7aa8b7;
        border-radius: 6px;
        outline: none;
      }
    </style>
  </head>
  <body>
    <a class="button" href="https://www.w3docs.com/learn-html/html-button-tag.html">HTML button tag</a>
  </body>
</html>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...