How do I upload hundreds of images in a post?

I want to load over 1000-3000 images per post using the "Add Media" functionality.

If I add them to the media upload window (drag or select), the browser warns me that the script is lagging. For example firefox:

A script on this page may be busy or may become unresponsive. Now you can stop the script, open the script in the debugger, or let the script continue.Script: ../ wp-admin / load-scripts.php? C = 0 & load% 5B% 5D = jQuery-core, jQuery-migrate, utilities, plupload , json2 & ver = 4.1: 2

I am guessing this is expected since the ajax call to load the images has not returned, so it seems to be busy.

How can I configure this to wait for this particular functionality to be called?

Note. This is part of a plugin I make when a user needs to attach hundreds of images in every post (eg gallery). Of course I want to use existing functionality, not reinvent the wheel.

+3


source to share


2 answers


This is the expected behavior since most ajax upload scripts send files on drag and drop. Depending on the size of the photos, you can consume the maximum amount of RAM for browsers (as most are 32 bits). 3000 images of 1 MB each are 3 GB and about the limit. It will probably take several hours to flip this data.

It was suggested to set up an sftp account and then import those script files. The transfer will take less time. Bulk imports won't take a minute or two.



The reason I am suggesting this is because web browsers were not designed to bulk download files. Is it possible? Yes. I recommend? Not. As well as I do not recommend taking my ferrari through a puddle 3 feet deep. Your php fill-in method for bulk upload loads your server as well. I would also not recommend parallelizing it. You will add significant load to your server and may cause the site to stop responding.

Doing the download outside of your web server (apache or ngix) is a much safer, more secure and less resource intensive solution.

+1


source


You want to add 1000 or more images in a post, directly upload

YOURSITENAME / wp-content / uploads / currentmonthfolder



and if you are done you have to add the img tag manually, specifically the post

0


source







All Articles