Skip to content

Commit

Permalink
Fixed bug in silverlight upload component that would keep sending 0by…
Browse files Browse the repository at this point in the history
…te packages when a picture was chunked before resized (file size was not updated after resize, so total number of chunks were incorrect)
  • Loading branch information
jayarjo committed Jan 22, 2011
2 parents 6a3fbd0 + 80497cc commit 334046f
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/csharp/Plupload/FileReference.cs
Expand Up @@ -121,13 +121,6 @@ public class FileReference {
this.chunk = 0;
this.chunking = chunkSize > 0;

if (this.chunking) {
this.chunkSize = chunkSize;
this.chunks = (int) Math.Ceiling((double) this.Size / (double) chunkSize);
} else {
this.chunkSize = (int) this.Size;
this.chunks = 1;
}

this.uploadUrl = upload_url;

Expand All @@ -148,6 +141,14 @@ public class FileReference {
}, this);
}

if (this.chunking) {
this.chunkSize = chunkSize;
this.chunks = (int) Math.Ceiling((double) this.Size / (double) chunkSize);
} else {
this.chunkSize = (int) this.Size;
this.chunks = 1;
}

this.UploadNextChunk();
}

Expand Down

0 comments on commit 334046f

Please sign in to comment.