Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Wininet... FtpGetFile Date Altered on Download!

Status
Not open for further replies.

kennedymr2

Programmer
May 23, 2001
594
AU
I am using Wininet to get files from a server.
I need to know the original Date and Time of the the file i am getting from the server.

If i use Ftpget

x = FtpGetFile(hconnection1, _
SremoteFile, _
SnewFile, _
False, _
FILE_ATTRIBUTE_ARCHIVE, _
FTP_TRANSFER_TYPE_ASCII, _
0&)

The file date and time is altered to current data and time.
eg. if i use filedatetime(snewfile)
or scripting. f.datecreated

???? 1. Can ftpget be told to leave the date alone??
2. Is there a way of 1st looking at the file on the server, getting the data , time, and then
altering the date/time on the file received.


Appreciate any help.
 
I have progressed as follows, but have struck a blank on how to get the files date.

Dim pData As WIN32_FIND_DATA, hFind As Long, lRet As Long
hFind = FtpFindFirstFile(hconnection1, "\xxx\aaaaaa.111", pData, 0, 0)

MsgBox (pData.cFileName)

-----------up to here ok......
But... not working

MsgBox (pData.ftCreationTime)



Appreciate any help
 
The following code should return the date the file was last modified.

Private Function GetLastMod(strURL As String)As String
Dim strHeader As String
'Cancel any current operations
Inet1.Cancel
'Set protocol to HTTP
Inet1.Protocol = icHTTP
'Open the URL URL
Inet1.OpenURL (strURL)
'Retrieve the date page was last modified
strHeader = Inet1.GetHeader("Last-modified")
GetLastMod = strHeader
End Function

Hope this helps,
Jonathon. Computer problems? Have you checked the loose nut in front of the keyboard yet?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top