How to access the Created Date and or Last edited date for inputfile?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

How to access the Created Date and or Last edited date for inputfile?

Torbs
Thank you so very much for this useful piece of Open Sauce software.  I am relatively new to ASP.net programming (well really formal programming altogether), and have found this neatupload useful for a great starting point.

Recently I have a situation where I would like to track the created date and/or the last edited date of the file in a database alongside the files.  Sort of a Document Management project, but my relative lack of experience has reared its ugly head once again and I can't seem to figure out how I might access these particular properties of the inputfile.

I am also tracking the filesize in my database and I 'assume' I can use inputfile.size to get that, am I correct in that assumption?

Thanks for any response it is greatly appreciated!
Reply | Threaded
Open this post in threaded view
|

Re: How to access the Created Date and or Last edited date for inputfile?

Dean Brettle
Administrator
For size, use InputFile.ContentLength.  The creation and modification dates aren't available because browsers don't send them with the file.

--Dean
Reply | Threaded
Open this post in threaded view
|

Re: How to access the Created Date and or Last edited date for inputfile?

Torbs
well that's a bite on the backside, stupid old browsers not sending me useful data like that ;)

Anyhow thanks for the heads up on the contentlength.  I had just stumbled across that myself, you know what happens when you ASSuME something...  It always has a tendency to make an @** out of ME...

-Torbs
Reply | Threaded
Open this post in threaded view
|

Re: How to access the Created Date and or Last edited date for inputfile?

Torbs
When the files is uploaded "Moveto" will the date be modified?  If not I could potentially access those pieces of information once the file is on my server.

Thoughts?????

-Torbs
Reply | Threaded
Open this post in threaded view
|

Re: How to access the Created Date and or Last edited date for inputfile?

Dean Brettle
Administrator
The creation and modification dates on the file will correspond to the date of the upload, not the date on the user's machine.  I don't think MoveTo() will modify them.  You can access them by creating a FileInfo object for the path you passed to MoveTo() and then using its properties.

--Dean
Reply | Threaded
Open this post in threaded view
|

Re: How to access the Created Date and or Last edited date for inputfile?

Torbs
fine idea if the file was local to the server, but I was hoping to get the dates from the users machine.  Its OK we will just have to live without that piece of information.

PS Thanks again for your wonderful help and project.