If you are getting a Divide By Zero exception in this code:
bytes += bytesRead;
int totalSize = (int)(fileSize) / 1000;
backgroundWorker1.ReportProgress((bytes / 1000) * 100 / totalSize, totalSize);
Then the problem has to be that
totalSize
is zero in the final line: which means that the
fileSize
is less than 1000.
We can't fix that for you: we can't make files bigger! You need to check where you get fileSize from using the debugger and either get a better value into it, or (if it is correct and below 1000) test for it and not do the divide at all.