1

I have written a program with which I can upload a file via drag and drop to an FTP. If the file has been uploaded and is free of errors, the software should generate a link.

For this I use an asynchronous upload and the method "UploadFileCompleted".

If I want to upload a large file, everything works fine except that the event does not trigger. With small Files everything works great.

EDIT: okay now 760MB File works , 800MB file does not work. the file is uploaded but the trigger does not fire.

using (WebClient client = new WebClient())
                {   
                    client.Credentials = Login;

                    client.UploadProgressChanged += (s, y) =>
                    {
                        progressBar.Value = y.ProgressPercentage *2;
                    };

                    client.UploadFileCompleted += WebClientUploadCompleted;
                    client.UploadFileAsync(new Uri(filePath), fileLink.FullName);
                }

    void WebClientUploadCompleted(object sender, UploadFileCompletedEventArgs e)
    {
         //this event does not fire if the file is to big
    }

what can I do to trigger the event?

DonKnash
  • 53
  • 9
  • take a look here it looks like you are missing an Event https://stackoverflow.com/questions/982299/getting-the-upload-progress-during-file-upload-using-webclient-uploadfile – MethodMan Dec 04 '17 at 15:07
  • @MethodMan Can you be more clear? I do not see any relation to that question. – Martin Prikryl Dec 04 '17 at 15:15
  • @Don Your code works for me. Maybe you should post a [mcve]. There's lot of unrelated rubbish in your code and there no implementation of `WebClientUploadCompleted`. How exactly do you check that the event is not triggered? Does your progress bar work? – Martin Prikryl Dec 04 '17 at 15:16
  • just edited the thread. My ProgressBar works fine – DonKnash Dec 05 '17 at 10:02
  • What is the size threshold when it stops working? – Magnus Dec 05 '17 at 10:09
  • the biggest working file i tried was 380mb, the smalles non working file was 1,8GB, i will try more different – DonKnash Dec 05 '17 at 12:13
  • okay now 760MB File works , 800MB file does not work. the file is uploaded but the trigger does not fire. – DonKnash Dec 05 '17 at 13:19

0 Answers0