CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Remove Timestamp from File Upload Name

Print topic Send  topic

Author Message
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.
> >
> >
>
>


Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.