Re: FTP Programming Question



On Mar 2, 5:16 pm, "Amil Hanish" <amilhan...@xxxxxxxxxxx> wrote:
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" <dush...@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.

another API to consider ... Secure FTP Factory for .NET

http://www.jscape.com/sftpdotnet/


.



Relevant Pages

  • Re: Error message when sending E-mail: Disc Space Exceeded.
    ... send yourself a single .jpg image, and check the filesize of the email when ... powerpoint slideshow occupies much more than its filesize when encoded to be ... put the large file on a web server and send the receiver a link to that. ... when attempting to send a PowerPoint slideshow. ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • Re: WMIC - wrong file size values
    ... GB CIM_DataFile FileSize limit ... case of a Windows 2000 WMI server. ... It was hard to find an example of CIM_DataFile with ConnectServer. ... ' SWbemLocator: Invalid parameter ...
    (microsoft.public.win32.programmer.wmi)
  • alerting on filesize on win2K Terminal Server
    ... I was wondering if there was any sort of alerting tools for a terminal ... Specifically to do with users' filesize. ... I have a Win 2000 Terminal Server, ...
    (microsoft.public.win2000.termserv.clients)
  • Re: FTP Programming Question
    ... completely uploaded to the server. ... it seems that the filesize before it hits the FTP server is not equal ... you are using binary mode. ...
    (microsoft.public.dotnet.framework)
  • FTP Programming Question
    ... I have an FTP programming question. ... completely uploaded to the server. ... it seems that the filesize before it hits the FTP server is not equal ... Public Function GetFileSize(ByVal sFileName As String) As Long ...
    (microsoft.public.dotnet.framework)

Loading