• fishouse

    (@fishouse)


    Is possible to rename the file after the upload?

    I save the the file into upload/import, but I need that the file is called import.csv indipendently from the original name

Viewing 1 replies (of 1 total)
  • Thread Starter fishouse

    (@fishouse)

    solved

    if (!function_exists('wfu_after_upload_handler')) {
    	function wfu_after_upload_handler($changable_data, $additional_data) {
            rename($additional_data['files'][0]['filepath'], dirname(__DIR__, 2).'/uploads/attestazioni/import.csv');
    		return $changable_data;
    	}
    	add_filter('wfu_after_upload', 'wfu_after_upload_handler', 10, 2);
    }
Viewing 1 replies (of 1 total)
  • The topic ‘rename file after upload’ is closed to new replies.