datadoit.com
|
| Posted: 09/24/2004, 8:32 AM |
|
CCS 2.3.2.24; PHP4
I've ripped through the docs and this forum, but can't find clear definitive
answer....
How can I change the file name of an uploaded file when it's sent to the
upload folder? Specifically strip out the timestamp portion.
Thnx.
|
|
|
 |
DonB
|
| Posted: 09/24/2004, 9:03 AM |
|
You can change the filename in the Before Process File event. But beware,
doing this will make it likely to get a duplicate filename, and the upload
will die if that happens.
I have been successful with letting the upload filename get stored as-is,
but when I display it, strip the timestamp. I even make use of this to
display the file date/time of upload later on, when displaying the files -
just parse the filename and format it with "-" and ":" characters in the
before show event..
--
DonB
http://www.gotodon.com/ccbth
"datadoit.com" <mike@datadoit.com> wrote in message
news:cj1em9$1dm$1@news.codecharge.com...
> CCS 2.3.2.24; PHP4
>
> I've ripped through the docs and this forum, but can't find clear
definitive
> answer....
>
> How can I change the file name of an uploaded file when it's sent to the
> upload folder? Specifically strip out the timestamp portion.
>
> Thnx.
>
>
|
|
|
 |
Don Safar
|
| Posted: 09/24/2004, 1:56 PM |
|
Modify the following line in function upload in classes.php to your liking.
$ActualFileName = date("YmdHis") . $index . "." . $FileName;
DonB is correct about duplicate names, you should check this prior to
upload.
"DonB" <~ccbth~@gotodon.com> wrote in message
news:cj1ggo$2jc$1@news.codecharge.com...
> You can change the filename in the Before Process File event. But beware,
> doing this will make it likely to get a duplicate filename, and the upload
> will die if that happens.
>
> I have been successful with letting the upload filename get stored as-is,
> but when I display it, strip the timestamp. I even make use of this to
> display the file date/time of upload later on, when displaying the files -
> just parse the filename and format it with "-" and ":" characters in the
> before show event..
>
> --
> DonB
>
> http://www.gotodon.com/ccbth
>
>
> "datadoit.com" <mike@datadoit.com> wrote in message
>news:cj1em9$1dm$1@news.codecharge.com...
> > CCS 2.3.2.24; PHP4
> >
> > I've ripped through the docs and this forum, but can't find clear
> definitive
> > answer....
> >
> > How can I change the file name of an uploaded file when it's sent to the
> > upload folder? Specifically strip out the timestamp portion.
> >
> > Thnx.
> >
> >
>
>
|
|
|
 |
|