Csharpnoob
Csharpnoob

Reputation: 41

How to create exemption for catching corrupted files upon upload?

First and foremost, thank you to anyone who is able to help with this seemingly simple problem I am having. Background: I have an application that uploads files to a server using Rebex. What I need to do for testing purposes is create a fake file, place it in the middle of all other files, and then create an exception in the program that catches that fake file (we'll call it "fileX"), and throws an error. Basically, the point of the test is to see what happens when the upload has to stop mid-upload process.

My upload code is as follows:

            Server.Upload(source, "/", Rebex.IO.TraversalMode.Recursive, Rebex.IO.TransferMethod.Copy, Rebex.IO.ActionOnExistingFiles.OverwriteOlder);
            Server.Disconnect();

What do I need to add under this code in order to stop the upload once it reaches "fileX"? I cant find any documentation on this type of test specifically.

Thank you!

Upvotes: 0

Views: 48

Answers (0)

Related Questions