开发者

Trying upload file (image) in chunks and after merging uploaded bytes file is corrupted why?

Trying to create custom upload control in silverlight app for uploading large file. I've very small image for testing 753 bytes size. When i set chunk size = 753 everything works fine, control recieves all 753 bytes at once, then i write these bytes array to FileSaveAs dialog (for testing purposes) stream and uploaded bytes appears as copy of uploaded image. When i set chunk size lets say = 500, then we need 2 chunks 500 + 253, when debuging i compare these bytes (two chunks) and both are the same as in case when uploading in one chunk.. the only one difference - i have 2 arrays instead of 1. After saving these merged chunks to new image file this file is corrupted. Its exactly the same size as original, but its corrupted i'm unable to preview it. Can't figure out whats the开发者_运维知识库 problem there, any ideas?

I've atached these images: there

a.jpg - original b.jpg - corupted (uploaded in chunks 500 + 253) c.jpg - uploaded when chunk size = 753


Looks like the first chunk in your 2-chunk-scenario got somehow totally messed up.

To help you with the problem, we need to see the relevant source.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜