Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > File upload date and Time

Reply
Thread Tools

File upload date and Time

 
 
Chris Strobel
Guest
Posts: n/a
 
      02-04-2004
Is there a way using the Input Type=File and ASP.NET to keep the original
date and time stamp of files I'm uploading? If not, what about getting the
original date and time stamps and changing them after the file is uploaded
to the server?

Thanks,
Chris


 
Reply With Quote
 
 
 
 
Marshal Antony
Guest
Posts: n/a
 
      02-07-2004
Hi Chris,
You can use File.GetLastWriteTime to get the date and time the
specified file or directory was last written to.
In C# for eg:
string file_path=@"c:\test\yourfile.txt";
DateTime dt=File.GetLastWriteTime(file_path);

In VB.NET
Dim file_path As String = "c:\test\yourfile.txt"

Dim dt As DateTime = File.GetLastWriteTime(file_path)

If you want to set the last write time to
some date and time you want :
For Eg:
In C#
File.SetLastWriteTime(file_path, DateTime.Now);
In VB.NET
File.SetLastWriteTime(file_path, DateTime.Now)
This will update the last write time to the current
time.

Hope this helps.
Regards,
Marshal Antony
..NET Developer
http://www.dotnetmarshal.com









"Chris Strobel" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Is there a way using the Input Type=File and ASP.NET to keep the original
> date and time stamp of files I'm uploading? If not, what about getting the
> original date and time stamps and changing them after the file is uploaded
> to the server?
>
> Thanks,
> Chris
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
w3.org suggestion .. page, date, time and topic, date, time code (wish list). Keith Cochrane HTML 2 08-06-2006 06:57 AM
covert time from date Hour min sec format to epoch time i.e time since 1 jan 1970 in C Summu82 C Programming 5 06-07-2006 02:51 PM
Upload a file without file Upload control - ASP.Net =?Utf-8?B?U2FyYXY=?= ASP .Net 3 08-03-2005 01:09 AM
Date, date date date.... Peter Grison Java 10 05-30-2004 01:20 PM
Date & Time chooser for java 1.1 - using only the mouse to select time & date Chris Berg Java 0 10-27-2003 10:59 PM



Advertisments