How To Make PDF File Downloadable In HTML Link - Edureka
Có thể bạn quan tâm
- Home
- Community
- Categories
- Web Development
- PHP
- How to make PDF file downloadable in HTML link
I am giving link of a pdf file on my web page for download, like below
<a href="myfile.pdf">Download Brochure</a>The problem is when user clicks on this link then
If the user have installed Adobe Acrobat, then it opens the file in the same browser window in Adobe Reader.
If the Adobe Acrobat is not installed then it pop-up to the user for Downloading the file.
But I want it always pop-up to the user for download, irrespective of "Adobe acrobat" is installed or not.
Please tell me how i can do this?
- html
- css
- javascript
- laravel
- php
- jquery
- flag
Your comment on this question:
Your name to display (optional): |
Email me at this address if a comment is added after mine: |
Privacy: Your email address will only be used for sending these notifications. |
Add comment Cancel |
1 answer to this question.
Your answer
Your name to display (optional): |
Email me at this address if my answer is selected or commented on: |
Privacy: Your email address will only be used for sending these notifications. |
Add answer Cancel |
Hello @kartik,
Try this:
<a href="./directory/yourfile.pdf" download="newfilename">Download the pdf</a>Where newfilename is the suggested filename for the user to save the file. Or it will default to the filename on the serverside if you leave it empty, like this:
<a href="./directory/yourfile.pdf" download>Download the pdf</a>Note:you should check compatibility first.
Check compatibility here: http://caniuse.com/#feat=download
Hope it helps!! Thank you!!
answered Aug 27, 2020 by Niroj • 82,840 points comment- flag
- ask related question
Your comment on this answer:
Your name to display (optional): |
Email me at this address if a comment is added after mine: |
Privacy: Your email address will only be used for sending these notifications. |
Add comment Cancel |
Related Questions In PHP
0 votes 1 answerHow do I add PHP code/file to HTML(.html) files?
Hello @kartik, You can't run PHP in .html ...READ MORE
answered Oct 22, 2020 in PHP by Niroj • 82,840 points • 676 views- html
- css
- javascript
- laravel
- php
How to include External CSS and JS file in Laravel?
Hello @kartik, The right way is this one: <script ...READ MORE
answered Oct 27, 2020 in PHP by Niroj • 82,840 points • 28,667 views- html
- css
- laravel
- javascript
- php
How to write file in UTF-8 format?
Hello @kartik, file_get_contents / file_put_contents will not magically ...READ MORE
answered Nov 5, 2020 in PHP by Niroj • 82,840 points • 6,074 views- html
- css
- javascript
- laravel
- php
How to check file extension in upload form in PHP?
Hello @kartik, Using if( $ext !== 'gif') might not ...READ MORE
answered Nov 8, 2020 in PHP by Niroj • 82,840 points • 17,127 views- html
- css
- javascript
- laravel
- php
Uncaught Error: Bootstrap's JavaScript requires jQuery
Hello @kartik, You have provided wrong order for ...READ MORE
answered Apr 28, 2020 in JQuery by Niroj • 82,840 points • 23,326 views- html
- css
- javascript
- jquery
- php
- laravel
How to make Bootstrap popover Appear/Disappear on hover instead of click?
Hello @kartik, Set the trigger option of the popover to hover instead ...READ MORE
answered May 12, 2020 in JQuery by Niroj • 82,840 points • 3,323 views- html
- css
- javascript
- laravel
- php
- jquery
How to enable Bootstrap tooltip on disabled button?
Hii @kartik, You can wrap the disabled button ...READ MORE
answered May 12, 2020 in JQuery by Niroj • 82,840 points • 5,121 views- html
- css
- javascript
- laravel
- jquery
- php
How to set cache false for getJSON in jQuery?
You can't pass any configuration parameters to ...READ MORE
answered Oct 7, 2020 in JQuery by Amit • 140 points • 2,953 views- html
- laravel
- php
- jquery
- javascript
- css
How do I convert a PDF document to a preview image in PHP?
Hello @kartik, You need ImageMagick and GhostScript <?php $im = new imagick('file.pdf[0]'); $im->setImageFormat('jpg'); header('Content-Type: image/jpeg'); echo ...READ MORE
answered Aug 14, 2020 in PHP by Niroj • 82,840 points • 4,807 views- html
- css
- javascript
- laravel
- php
How to make asynchronous HTTP requests in PHP?
Hello @kartik, Use this code: function post_without_wait($url, $params) { ...READ MORE
answered Sep 17, 2020 in PHP by Niroj • 82,840 points • 2,652 views- html
- css
- javascript
- laravel
- jquery
- angularjs
Recent in PHP
- What strategies can I use to limit the impact of HTTP 429 errors on dependent services in a microservice architecture? 4 days ago
- What is PHPSESSID? Aug 8, 2022
- getenv() vs. $_ENV in PHP Aug 8, 2022
- How to make a nice "date picker" in PHP? Aug 8, 2022
- Interface or an Abstract Class: which one to use? Aug 8, 2022
- All categories
- Artificial Intelligence (3)
- Generative AI (173)
- ChatGPT (21)
- Apache Kafka (84)
- Apache Spark (596)
- Azure (157)
- Big Data Hadoop (1,907)
- Blockchain (1,673)
- C# (141)
- C++ (272)
- Career Counselling (1,060)
- Cloud Computing (3,698)
- Cyber Security & Ethical Hacking (408)
- Data Analytics (1,266)
- Database (858)
- Data Science (78)
- DevOps & Agile (3,805)
- Digital Marketing (121)
- Events & Trending Topics (28)
- IoT (Internet of Things) (387)
- Java (1,296)
- Kotlin (8)
- Linux Administration (389)
- Machine Learning (337)
- MicroStrategy (6)
- PMP (536)
- Power BI (808)
- Python (3,223)
- RPA (653)
- SalesForce (122)
- Selenium (1,571)
- Software Testing (58)
- Tableau (608)
- Talend (73)
- TypeSript (124)
- Web Development (3,188)
- Ask us Anything! (70)
- Others (2,245)
- Mobile Development (395)
- UI UX Design (24)
Join the world's most active Tech Community!
Welcome back to the World's most active Tech Community!
Sign up with Gmail Sign up with FacebookOR
Password must haveAt least 1 upper-case and 1 lower-case letter
Minimum 8 characters and Maximum 50 characters
SIGN UP Already have an Edureka Account? Login Forgot Password? LOGIN Don’t have edureka account? Sign Up resend ? Password must haveAt least 1 upper-case and 1 lower-case letter
Minimum 8 characters and Maximum 50 characters
reset password Don’t have edureka account? Sign Up reset password Don’t have edureka account? Sign Up Send Code Don’t have edureka account? Sign UpSubscribe to our Newsletter, and get personalized recommendations.
Sign up with Google Signup with FacebookAlready have an account? Sign in.
REGISTER FOR FREE WEBINAR X Years of Experience* Student 0-2 Years 2-5 Years 5-10 Years 10+ Years REGISTER NOW Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP "PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.Từ khóa » Html And Css Pdf File Download
-
[PDF] Duckett.pdf
-
[PDF] HTML & CSS: The Complete Reference, Fifth Edition
-
Web Design With HTML And CSS - PDF Drive
-
HTML And CSS PDF - FreePdf
-
HTML CSS Books All Free Download
-
HTML A Download Attribute - W3Schools
-
[PDF] Sams Teach Yourself HTML, CSS, And JavaScript All In One
-
HTML And CSS : Design And Build Websites PDF Download
-
Download Pdf File Using HTML - Javatpoint
-
How To Make PDF File Downloadable In HTML Link? - Stack Overflow
-
Download Free Tutorials And Courses On Html And Css Tutorial
-
Pdf File Download In Html Code Example
-
How To Create Downloadable Pdf Link Html/css Code Example
-
Başlıksız