I want to attach a file already on server but outside the wp uploads directory to a post, so I tried the media_handle_sideload
and used the download_url()
on the file’s URL I’m trying to attach, however for some reason, the download_url
cannot access my server, is there a work around that I can do so instead of giving media_handle_sideload
a $_FILES array I can give it the file absolute path? Or can I move a file already on server to the temp folder?