Can Not Upload Media Items into Media Library or Wiki

I uploaded to the wp-content/uploads/2016/04 folder in cpanel over 200 PDF files of sizes ranging from 100 MB to over 500 MB. The reason I uploaded them to cpanel, and not using Upload Media in the Media Library was that I kept getting HTTP errors using WP. BUT, I don't know how to "link" the media items in the uploads folder to my WP database so I can insert them into my wikis.

Also, I just now tried, again, to upload just 1 of the 200+ files into first a Wiki, then independently into the Media Library. I used both the multi-file uploader, then the single file uploader. After less than a minute of uploading the file, I get the HTTP error.

This problem started early April, and here it is at the end of April and it is still happening.

The Add Media option as well as the Media Multifile uploader works for smaller files. Also, I had little difficulty uploading the files into cpanel - same server as WP uses for my site, just using cpanel software not WP software. All the permissions are identical in the uploads folder for 2016 04, so it's not permissions.

The EASIEST thing would be for you to tell me how to "link" or edit some file in WP to include all the filenames of the 200+ new files so WP 'knows' I have them.

There 'should' be some index file that has those names, correct?

Please advise.

Mary :slight_smile:

  • Adam Czajczyk

    Hello Mary,

    I hope you're well today and thank you for your question!

    The size of a file allowed to be uploaded is by default limited by a few factors:

    - PHP setting: upload_max_filesize
    - PHP setting: post_max_size

    While raising all these limits is possible (though may require some assistance from hosting provider) it still may not be enough as upload of such a huge file takes time and PHP also limits the maximum script execution time. This explains the difficulties that you experienced.

    The simplest way would worth trying would be to get in touch with your host and ask them if they could set "upload_max_filesize" and "post_max_size" PHP options for you to a value of at least 512M and a "max_execition_time" PHP option to as high value as possible (preferably to "0" which means "no limit" at all).

    Then you could add this line to your "wp-config.php" file and hopefully this would let you upload your PDFs directly to a Media Library and/or Wiki:

    define('WP_MEMORY_LIMIT','512M');

    The line should be placed above the "/*That's all, stop editing..." line.

    Having said that, let me explain a bit more. I'm suggesting this because this could solve the problem and let you easily upload similar files in future. All the files that you manually uploaded (either via cPanel or via FTP) should be added to a database, otherwise WordPress will not be able to recognize them. Making changes directly to a database is always risky and sometimes quite difficult operation so it's better to avoid it at all cost unless there's no other option.

    However, it seems there's a plugin that should help you add already uploaded files to your Media Library. I tested it on few small files and it seems to be working but I must say I'm not sure how it will work with a huge set of "heavy" files but it's surely worth giving a try:

    https://wordpress.org/plugins/add-from-server/

    The idea behind it is to let you upload files via FTP (or cPanel the way you did) and then the plugin should identify them and add data to a WordPress database.

    Let me know please if it worked for you!
    Best regards,
    Adam

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.