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.