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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ftp using wininet.dll file size

Status
Not open for further replies.

angela4eva

Programmer
Apr 29, 2005
46
US
how can i find the size of file on the remote server .i am using ftpputfile in wininet.dll..please help urgent
 
Try using FtpGetFileSize; as follows:

Public Declare Function FtpGetFileSize Lib "wininet.dll" (ByVal hFtpSession As Long, _
ByVal lpszRemoteFile As String) As Long

Public Function SizeOfFile(ByVal RemoteFileName As String)
Dim hFile
hFile = FtpOpenFile(hConnect, Trim(RemoteFileName), GENERIC_READ, _
FTP_TRANSFER_TYPE_UNKNOWN, 0)

FileSize = FtpGetFileSize(hFile, RemoteFile)

End Function

~CIAO~
 
works great..but when i try to rename the fiel on the server it cannot do i need to close the file?
 
What error do you get when renaming? Do you have rights to rename?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top