473,322 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Adding a timestamp to a filename

I am uploading files to my webserver using an asp upload script and would
like to add a timestamp just before they are saved to the server.
This would mean that filename.txt on my server would be uploaded to the
webserver as filenameYYMMDDhhmmss.txt or something similar.
Can anyone advise how to do this?
Jul 19 '05 #1
2 8218
> I am uploading files to my webserver using an asp upload script and would
like to add a timestamp just before they are saved to the server.
This would mean that filename.txt on my server would be uploaded to the
webserver as filenameYYMMDDhhmmss.txt or something similar.
Can anyone advise how to do this?


Most likely, depends on what upload component you are using. Several have a
SaveAs method or something equivalent.

--
http://www.aspfaq.com/
(Reverse address to reply.)
Jul 19 '05 #2
Hello,

If your file name 100% has file extension:

Get file extension:
Response.Write UBound (Split (LCase ("filename.com.txt"), ".", -1, 1))

Get date/time stamp:
N = Now
Response.Write Right ("0" & Year (N), 4) & Right ("0" & Month (N), 2) &
Right ("0" & Day (N), 2) & "_" & Right ("0" & Hour (N), 2) & Right ("0" &
Minute (N), 2) & Right ("0" & Second(Now), 2)

Or, simple rename file later, after upload. Do upload in some temporarely
folder (by date/time), then rename file.

With best regards,

--

Should you have any questions, please don't hesitate to contact me.
If you response to an email, please quote the complete message.
http://1click.lv

"kbrad" <kb***@discussions.microsoft.com> wrote in message
news:9D**********************************@microsof t.com...
I am uploading files to my webserver using an asp upload script and would
like to add a timestamp just before they are saved to the server.
This would mean that filename.txt on my server would be uploaded to the
webserver as filenameYYMMDDhhmmss.txt or something similar.
Can anyone advise how to do this?

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Stegga | last post by:
Hi there, I'm trying to add 1 second incrementally to a timestamp while looping through it and I am pulling my hair out. Please can someone help me? example of code: $calc_timestamp =...
1
by: Jimbo | last post by:
Hello, I'm not a perl programmer but I can kind of hack my way through some simple scripts. What I am trying to do is get it so a line break <br> is automatically placed when I hit the return...
2
by: Craig Keightley | last post by:
How do i display a date as a new column 7 days after the initial timestamp eg current timestamp = 20050310000000 if i add 7 days to this won't it result in 20050317000000 eg SELECT *,...
0
by: Michael Probst | last post by:
Hi all, I am new to .NET and the way XML data is handled in .NET I wrote a small application with .NET forms in C++ The application reads data from an XML file to fill-in the fields of the...
2
by: jay | last post by:
hi, Question on Load/import command. consider a sample table create table table_name ( col1 timestamp not null default current timestamp, col2 int, col3 int, col4 int, primary key(col1) );...
0
by: Sarah | last post by:
hi, i'm saving an excel workbook by the following: xlworkbook.SaveAs("mybook.xls",Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Excel.XlSaveAsAccessMode.xlNoChange,...
7
by: JJ | last post by:
How do I set one field to have the updated timestamp, and another to have the created timestamp? I want to do this directly from code generated from DB Designer if possible?! JJ
0
by: AndyL69 | last post by:
Hello I've got a very strange Problem. When im adding a new ACE entry to a UNC Direcotry the inherented ACL's will be lost. When I'm adding a new ACE to a directory / file in this UNC path the...
2
by: Craig | last post by:
We are trying to create an inhouse ID card system. What we would like to do is to have a webcam feed displayed in a webpage and for a user to be able to click a button to save the currently...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.