Skip to content
Advertisement

Tag: export-to-csv

Save CSV Export to Server

I have the code below which triggers when a button is pressed in the WordPress admin panel. This opens a csv file called ‘ss-stock-export.csv’. How can I save this file to my server in my uploads directory at wp-content/uploads/exports/? I tried to use file_put_contents but that doesn’t seem to be working right. The CSV file appears in the right spot

Advertisement