I am using powermail extension to create a form for upload of several file types. This form is located in a login area. For every logged in user there is a folder with its name created where the uploaded files are stored.
# get personal storage folder for logged in user
lib.userfolder = TEXT
lib.userfolder {
data = TSFE:fe_user|user|username
wrap = fileadmin/user_upload/|/
required = 1
}
# Powermail file upload settings
plugin.tx_powermail.settings.setup.misc.file {
folder = fileadmin/user_upload/
size = {$plugin.tx_powermail.settings.misc.uploadSize}
extension = {$plugin.tx_powermail.settings.misc.uploadFileExtensions}
randomizeFileName = {$plugin.tx_powermail.settings.misc.randomizeFileName}
}
this works fine so far. The problem is that if a file with a name "example.pdf" already exists and another file named "example.pdf" is uploaded the file is not overwritten. Instead the uploaded file "example.pdf" will be renamed to "example_01.pdf". A good behaviour in general but not fitting my needs. I need an approach to handle this problem would be nice to get some hints here.