Re: FTP Programming Question



Forget doing FTP using .net...much easier. use the free API at:

http://www.enterprisedt.com/products/edtftpnetexpress/overview.html

I've used this before...very nice.

Amil

"pbd22" <dushkin@xxxxxxxxx> wrote in message
news:1172872001.545493.260010@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Hi.

I have an FTP programming question.
I want the total size of a file being uploaded "before" it is
completely uploaded to the server. I need this for the condition:
when currentbytes = totalbytes, do something. But,
it seems that the filesize before it hits the FTP server is not equal
to the same file's bytes on the other end. I am using either of the
two methods to get the filesize "before" it lands on the remote
server:

Dim postedFile As HttpPostedFile = myfiles(count)
postedFile.InputStream.Length

-- or --

postedFile.ContentLength

and the below method to get the filesize once it is on the FTP server
(and fully uploaded):

Public Function GetFileSize(ByVal sFileName As String) As Long

If (Not (m_bLoggedIn)) Then
Login()
End If

SendCommand(("SIZE " + sFileName))

Dim size As Long = 0

If (m_iRetValue = 213) Then
size = Int64.Parse(m_sReply.Substring(4))
Else
Throw New IOException(m_sReply.Substring(4))
End If

Return size

End Function

Does anybody see why this could be happening? Has anybody else noticed
this distinction?

Thanks in advance.



.



Relevant Pages

  • Re: Microsoft FTP Server problem on W2K?
    ... It is a UNISYS ClearPath mainframe system that is trying to FTP using ... passive mode to a MS FTP server. ... Currently the mainframe FTPs in ACTIVE mode. ... Since the mainframe pushes files to our customers over a WAN connection, ...
    (microsoft.public.inetserver.iis.security)
  • RE: FTP Upload
    ... FTP server to the following specified size. ... //set or get the remote path of the FTP server that you want to connect. ... //set the class MessageString. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: FTP Upload
    ... FTP server to the following specified size. ... //set or get the remote path of the FTP server that you want to connect. ... //set the class MessageString. ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: vsftpd beginners tutorial?
    ... # This file was created to illustrate the steps needed to create a new FTP ... Why vsftpd as this FTP Server? ... System software customization considerations. ... User and Group Configuration ...
    (RedHat)
  • Re: IPSwitch, Inc. WS_FTP Server
    ... > bounce attack as well as PASV connection hijacking. ... > The FTP bounce vulnerability allows a remote attacker to cause the ... > anonymously along with any internal addresses that the FTP server has ... That means it's got to handle a PORT ...
    (Bugtraq)