getting rid of year/date/time in attachment name

albert 16 Apr, 2008
hi

my upload file works fine.
but the attachment comes over with this name
20080415211155_SolutionDesignArchitect.rtf

as you can see, the yeardatetime has been appended to the file name..
how do I get rid of it?

many thnx<br><br>Post edited by: albert, at: 2008/04/16 05:26
GreyHead 16 Apr, 2008
Hi albert,

I think that ChronoForms does this automatically to handle the case where there are many uploads with the same name.

You can either hack the code, or write some code to rename the file.

The filename change is around line 231 in chronocontact.php
$filename = date('YmdHis').'_'.preg_replace('`[^a-z0-9-_.]`i','',$_FILES[$allowed_s2[0]]['name']);
Bob
albert 18 Apr, 2008
without the date so i change line to :
$filename = preg_replace('`[^a-z0-9-_.]`i','',$_FILES[$allowed_s2[0]]['name']);

Edited to remove quote<br><br>Post edited by: GreyHead, at: 2008/04/18 08:32
dkartuzinski 28 May, 2009
I was able to find this line of code in chronoformuploads.php. It worked to remove the code from there.
-DK
This topic is locked and no more replies can be posted.

VPS & Email Hosting 20% discount
hostinger