简体   繁体   中英

Button Link for PDF Download Not Working

I am trying to link my resume button to a PDF file. However, "Safari can't find the file" keeps on popping up.

     <div class="page-content">
            <div class="container">
                <div class="row">

                <div class="m-bot-6">
                    <a href="/documents/resume.pdf" class="btn btn-medium btn-circle btn-theme-color"download>Resume</a>
                </div>
                </div>
            </div>
        </div>

My pdf is in the documents folder.

问题似乎出在您的文件路径上,您提供的路径指向驱动器根目录下位于documents文件夹中的PDF,请尝试./documents/resume.pdf

"/documents/resume.pdf" is referring to an absolute path.(leading /)

if your page is say domain.com/somepath/yourpage.htm and the the documents folder is domain.com/documents it would work

if the documents folder is in the same folder as the web page change it to; "documents/resume.pdf" and it will refer relative to the path instead then the path structure will not get in the way

if the page and PDF are in the same folder "resume.pdf" will work

it's always handy to understand absolute and relative paths

also note; most servers are case sensitive so match the names the same

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM