How to download CSV from sub directory in uploads folder
hello guys i donot have experience working with the csv. I have a very big form i wanted to make a custom csv export for this form and a new csv is generated every time the form is submited. i am using gravity form and gravity form gform_post_submissiom
hook to capture the entry. Everything is working fine until this point. I have created a sub dir in uploads folder. Csv for every entry is being created in this folder. I have created a custom meta box on the entry page too. I just need some guidance to how to download those csv. i am using following code for downloading the csv but it says failed server problem
function download_for_client_asset_entry($args){
$form = $args['form'];
$entry = $args['entry'];
$path = wp_upload_dir();
$path = $path['basedir'].'/client-assets';
$event_content = array();
$filename = /client-assets456.csv;
$filename = $path.$filename;?
a download href=?php echo $filename; ?download csv/a
?php
}
right now i have given the name of one csv to test the things but it is still not working I have written all the code in functions.php