Change uploaded file name

Home Forums Quform WordPress Change uploaded file name

This topic is: resolved
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #34703
    marianogi
    Participant

    Hi!

    I am having problems trying to change the uploaded file name. I tryied with this code I saw in the forum but it does no work for me and I don’t know why:

    
    function my_custom_filename($filename, $element, $form)
    {
        // Some transformations of '$filename' here
        return sanitize_file_name($filename);
    }
    add_filter('iphorm_filename_iphorm_4_69', 'my_custom_filename', 10, 3);
    

    As you can see, the field of the upload is 4_69. I tryied also another filter thinking this code could be old: ‘iphorm_filename_quform_4_69’.

    I also tryied without any transformation at all, just simply returning $filename unaltered. I know it does not work because I tried to send an email.

    But nothing worked for me.
    Please help!

    • This topic was modified 2 months, 1 week ago by marianogi.
    • This topic was modified 2 months, 1 week ago by marianogi.
    • This topic was modified 2 months, 1 week ago by marianogi.
    #34709
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #34713
    marianogi
    Participant

    Hi!, thank you!, I thought some “iphorm” hooks were still alive. Your solution worked great.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2022 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy