Hi
I am making a utility in Visual basic.Net 2005 to upload and download files from a ftp server.
i am using Aspose.network.ftp for that
Following is my code. I am getting the error 550 permission denied for uploading or downloading files.
Please help me its urgent
Module Module1
Sub Main()
Dim client As Aspose.Network.Ftp.FtpClient = New Aspose.Network.Ftp.FtpClient
client.Host = "192.168.18.100"
client.Port = 21
client.Username = "moayad"
client.Password = "mah50500"
client.DataConnectionMode = DataConnectionMode.Auto
AddHandler client.TransferProgress, AddressOf OnTransferProgress
AddHandler client.TransferCompleted, AddressOf OnTransferComplete
Try
'auto login
client.Connect(True)
MsgBox(client.GetServerStatus())
client.TransferType = Aspose.Network.Ftp.TransferType.Ascii
client.TransferType = Aspose.Network.Ftp.TransferType.Binary
'download file ftp://192.168.18.100:21/test.data to c:\download
'client.Download("/epro/webclassifieds.doc", "f:\moayadweb\webclassifieds.doc")
'upload file c:\\download\\test.data to ftp://192.168.18.100:21/test.data
client.Upload("C:\EPRO\images\C00002.jpg", "/epro/c00002.jpg")
client.Disconnect()
Catch fe As FtpException
MsgBox(fe.Message)
End Try
System.Console.Read()
End Sub
'transfer progress event handler
Public Sub OnTransferProgress(ByVal sender As Object, ByVal e As TransferProgressEventArgs)
If e.TransferStatus = TransferStatus.Downloading Then
Console.WriteLine("Received " & e.TransferingBytes & " bytes")
ElseIf e.TransferStatus = TransferStatus.Uploading Then
Console.WriteLine("uploaded " & e.TransferingBytes & " bytes")
End If
End Sub
' transfer complete event handler
Public Sub OnTransferComplete(ByVal sender As Object, ByVal e As TransferCompletedEventArgs)
If e.TransferStatus = TransferStatus.Downloading Then
Console.WriteLine("Download Completed, totally transfered " _
& e.TotalTransferedBytes & " bytes")
ElseIf e.TransferStatus = TransferStatus.Uploading Then
Console.WriteLine("upload Completed, totally transfered " _
& e.TotalTransferedBytes & " bytes")
End If
End Sub
End Module
