Within a plugin I am generating an image, I would like to save this image to the upload folder and update the WPDB with the location of said file. I cant find any build in wordpress functions to handle saving/writing/adding a file to the upload folder, should I just do this the old fashioned way with php, or is there something built into WordPress that I’m missing?
Leave a Reply
You must be logged in to post a comment.
Check into the functions: wp_handle_upload() and media_handle_upload()
You need only to save generated file in the upload folder!… Use php.
If you need to add this file in
Media libary
than use wp_insert_attachment()