Question

How to upload a big PDF on the website?

Hello,

I am new to web development. I just created a website and uploaded it on the digital ocean $5 server by installing wordpress. Now I want to upload a PDF of 200 MB, but I am unable to do it with wordpress. Please tell me how to do it.

And please tell me how I can add this PDF to print on button click like this website.

Thanks


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

KFSys
Site Moderator
Site Moderator badge
April 10, 2023

Hey there,

You’ll need to increase the PHP limits you have. To do that, you can increase a couple of values in your php.ini file. To update the php.ini settings to allow you to upload a PDF that’s 200MB, you can follow these steps:

  1. Open the php.ini file.
  1. nano /etc/php/8.1/apache2/php.ini
  1. Increase the upload_max_filesize and post_max_size directive to a value that is greater than the size of the PDF file you want to upload. For example, to allow a 200MB file to be uploaded, you could set this directive to:
  1. upload_max_filesize = 200M
  2. post_max_size = 210M
  1. Save and close the php.ini file.
  2. Restart Apache to apply the changes:
  1. sudo systemctl restart apache2

Localte PHP.ini file

The location of the php.ini file can vary depending on the operating system and the way PHP is installed. Here are some common locations where you can find the php.ini file:

  1. Ubuntu or Debian:

    The php.ini file is typically located in /etc/php/{version}/apache2/ directory for Apache or /etc/php/{version}/cli/ for the command-line version of PHP.

  2. CentOS or Fedora:

    The php.ini file is usually located in /etc/ directory.

  3. macOS:

    The php.ini file is located in /etc/ directory.

  4. Windows:

    The php.ini file is usually located in the C:\Windows\ directory or in the directory where PHP is installed.

If you are unsure where your php.ini file is located, you can use the phpinfo() function to display the location of the php.ini file. To do this, create a PHP file with the following code:

<?php phpinfo(); ?>

Save the file in your web server’s document root directory (e.g., /var/www/html/) and access it in a web browser. The resulting page will display detailed information about your PHP installation, including the location of the php.ini file.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up