I am trying to find a way to add images to the Media Library without using POST and $_FILES.
I am developing a plugin to integrate an image database with the WordPress Media Library. The image database returns a base64-encoded jpeg file and now I’m trying to figure out how to get that into the Media Library.
I can save it to disk, but any attempts to upload it through wp_handle_upload() fails because the image has not been uploaded to the server through POST. I can manually add the image to $_FILES, but this will fail because it will not pass move_uploaded_file().
Ideally, I would like to pass the base64-encoded jpeg to WordPress and have it save the file in the Media Library, but if there is a command to do this, I have yet to find it.
Any suggestions would be appreciated.
- The topic ‘importing images to the Media Library from a Database’ is closed to new replies.