How To Host PDF files in Github | Create Download and Preview Link of PDF file

So How to Host your PDF files in Github and create a Download and Preview link of that pdf file so that you can use on your website or blog?

You can host an unlimited amount of files and any type of files in Github. Github can be used as file storage system like Google drive. Following are the simple steps to create download and preview link of pdf files hosted in Github.
  1. Create a Github account: First, you need to create a Github account. For that:
    • Go to Github.com 
    • Complete the signup process and verify your email address. 
    • Simply Sign in
    • Now you have your own GitHub account.
  2. Create a new repository
    • Click the +  button on the top right corner. 
    • Click on New repository and name it what you want [In My case I will name it PdfHosting].
    • Check the public option. 
    • Click Create repository.
  3.  Uploading your pdf file
    • Click "uploading an existing file"
    • Click choose your files.
    • Navigate your file and upload it. 
    • Now Click on Commit Changes.
  4. Create a new branch 
    • Now you have to create a new branch named as gh-pages
    • Click on the pdf file you uploaded. 
  5. Most important step
    • Copy the URL of the pdf file.
    • The format of the URL is:
    • https://github.com/USERNAME/REPOSITORY_NAME/blob/gh-pages/PDF_FILENAME.pdf
    • Now all you have to do is edit and twist the above URL into following: 

Preview link:  

https://USERNAME.github.io/REPOSITORY_NAME/PDF_FILENAME.pdf



Download Link:

https://raw.githubusercontent.com/USERNAME/REPOSITORY_NAME/gh-pages/PDF_FILENAME.pdf  

[make sure your URL format is as specified above]

So you can use these link to put a Preview and Download pdf option on your website or blog as:

<a href="https://USERNAME.github.io/REPOSITORY_NAME/PDF_FILENAME.pdf" target="_blank">Preview PDF</a>


<a href="https://raw.githubusercontent.com/USERNAME/REPOSITORY_NAME/gh-pages/PDF_FILENAME.pdf" target="_blank">Download PDF</a>

In this way, you can create a download and preview link of that pdf file so that you can use on your website or blog.

If you have any confusion in this method simply contact me on Facebook or Instagram or email me.
Facebook
Instagram
email: sandeshshrestha2018@gmail.com


Related Posts:

  • How to host your website on Github for free. 
How To Host PDF files in Github | Create Download and Preview Link of PDF file How To Host PDF files in Github | Create Download and Preview Link of PDF file Reviewed by Sandesh Shrestha on 01 April Rating: 5

1 comment:

  1. Play Free Slots at Mapyro Casino
    Try over 남원 출장마사지 500 양주 출장샵 free online slot games 영천 출장안마 at Mapyro Casino. 원주 출장마사지 Sign up and get free chips & spins. No sign-up or download required. 서울특별 출장샵

    ReplyDelete

Powered by Blogger.