alexandru-burca/woocommerce-gateway-purchase-order-file

Files uploaded to /wp-content/uploads/

Closed this issue · 1 comments

Hi,

Firstly - thanks for this it works very well! However I have just discovered that PO files are uploaded to /wp-content/uploads/ which is publicly accessible. Is there any way to change where the files are uploaded to?

Many thanks,

Ben

Hi there, you can try updating this method.
I used wp_upload_bits to upload the file, it creates a file in the upload folder.
So instead of using this WP function try using a default PHP function, like for example move_uploaded_file and change the destination folder. However, the link will still be public accessible, you will change only the destination folder. And this makes sense because the file URL is attached to the default email body and must be public accessible.