ASP.NET FileUpload

Hello!

I am using the ASP.NET FileUpload control so that users can upload text files to our web server. Everything works fine in terms of saving the file to where we wanted, etc., using the SaveAs () method of the control.

But we were taken aback by one seemingly simple warning: the original time stamp of the downloaded file was lost, for example, the date of the last change and the date of creation. The last modification date and creation date become the actual date and time when the file is saved on the server.

My question is: is it worth preserving the original timestamp by setting some attributes that I still don’t know about, or can I read the file metadata to get its initial timestamp?

Everyone is welcome any suggestions and suggestions.

John

+5
source share
1 answer

If the download file itself does not contain this data, then no.

When a file is uploaded to the web server, the binary data for the file is sent to the server, not the “file” as it appears on the file system. For example, you do not know that your file comes from a compatible file system; you get only your data. Therefore, metadata is not available.

+4
source

All Articles