Renaming uploaded file to match another one in a different field

Home Forums Quform WordPress Renaming uploaded file to match another one in a different field

This topic is: resolved

This topic contains 2 replies, has 2 voices, and was last updated by  cahoots 1 month, 2 weeks ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #29984

    cahoots
    Participant

    I have used the custom code example to dynamically direct uploaded files to a path defined by form elements. All good!

    My form requires two single file upload fields – one for an image, and one for an audio file.

    I would like to be able to take the filename of the uploaded image file and rename the audio file so they will both have the same name, but keep their original extensions. I want to end up with something like DSC_0023.jpg and DSC_0023.mp3

    I tried “hacking” the file renaming example and using the php pathinfo() function but evidently my coding skills were not up to understanding if/when/how to use it.

    I need the renaming to work such that it doesn’t cause any issue with the dynamic custom path for uploading the files.

    Any pointers?

    Thanks in advance.

    #29995

    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.

    #29998

    cahoots
    Participant

    Perfect! Exactly what I needed.
    Love the flexibility of this plugin . . .

    Regards,
    Mark

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

You must be logged in to reply to this topic.

Be inspired. © 2019 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy