Change name/path of the file after upload

in Download Manager Free

Viewing 4 posts - 1 through 4 (of 4 total)
Nov 24, 2020 at 10:18 am
#141430
Participant
Julie M
OP

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…

Nov 26, 2020 at 8:53 am
#141622
Participant
Julie M
OP

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…

Nov 26, 2020 at 1:12 pm
#141645
Moderator
Nayeem Riddhi
Staff

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

Nov 26, 2020 at 4:55 pm
#141673
Participant
Julie M
OP

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.