Error Exception :Error deleting file 'myFiles'. After resumable file upload

Advertisement

Abdullah_Mukhtar
Joined:
Posts:
2
Location:
Pakistan

Error Exception :Error deleting file 'myFiles'. After resumable file upload

While uploading file using WinSCP .NET library following error occurred:
Error Exception :Error deleting file 'myFiles'. After resumable file upload the existing destination file must be deleted. If you do not have permissions to delete file destination file, you need to disable resumable file transfers.
General failure (server should provide error description).
Error code: 4
Error message from server: Failure
Bellow is my code
using (Session session = new Session())
{
    session.Open(sessionOptions);
 
    Console.WriteLine("Connection Successful...");
 
    RemoteDirectoryInfo directoryInfo = session.ListDirectory("/");
 
    // Upload files
    TransferOptions transferOptions = new TransferOptions();
    transferOptions.TransferMode = TransferMode.Binary;
    TransferOperationResult transferResult;
 
    if (File.Exists(stFileName))
    {
        transferResult = session.PutFiles(stFileName, RemoteFolderPath, false, transferOptions);
 
        // Throw on any error
        transferResult.Check();
 
        // Print results
        foreach (TransferEventArgs transfer in transferResult.Transfers)
        {
            Console.WriteLine("Upload of {0} succeeded", transfer.FileName);
        }
    }
    else
    {
        Console.WriteLine("File not found : " + stFileName);
    }
}

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,034
Location:
Prague, Czechia

Re: Error Exception :Error deleting file 'myFiles'. After resumable file upload

What is your question?
Do you or do you not have the permissions to delete the file?
Are you asking how to disable the resumable transfer? Or are you asking why do you get the error?

Reply with quote

Advertisement

You can post new topics in this forum