Change name/path of the file after upload

Viewing 4 posts - 1 through 4 (of 4 total)
#141430

Julie M
Participant

Hello here,

I would like to change the name and path of my file after i upload it on my wordpress.

I use this filter “wpdm_after_upload_file” in functions.php of my wordpress template but…

I dont understand how to change it…

add_filter('wpdm_after_upload_file',function($filename){
     $filename = 'test.pdf';
     var_dump($filename); 
     return $filename;
          
  }, 1, 10);

var_dump($filename) ►

string(8) “test.pdf”
|||name.pdf|||

I would like to change the name/path with chosen categories.
Thanks for your help…

#141622

Julie M
Participant

Nobody can help me for this problem?
I don’t want to change the code of the function uploadFile to the plugin and the filter dont rename my file…

#141645

Nayeem Riddhi
Moderator

Sorry for your inconvenience, this filter is now deprecated, https://www.wpdownloadmanager.com/doc/filter-reference/wpdm_after_upload_file-filters-applied-uploaded-file-name/, however, soon it will be updated

thanks

#141673

Julie M
Participant

Oh okay no problem!
Thank you for the answer

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Change name/path of the file after upload’ is closed to new replies.