开发者

File API: Blob.slice - sliced from start, or byte after start?

got a interesting question, but I can't find any documentation about it. Firefox 4 beta 10 supports the new Blob.slice method, which slices a Blob instance. slice takes two arguments: blob.slice(start, length). Now, I'm interested wether it slices from start + 1 or from start, which would mean that I would have to increment start by one for each slice of the file.

Has anyone tried this out? I'm having some problems uploading the slices yet, but once that's done I'll post my experiences here as well.

Thanks alread开发者_运维技巧y,

Fabian

resource: https://developer.mozilla.org/en/DOM/Blob


Ah, I got the answer. Turns out I had to read the W3C draft, but I didn't. I've sliced the images, send them one by one to a php script and put them back together. However, I've got a totally different problem now: the files are sent in the wrong order and put together in the wrong order :'( (probably due to the async behaviour of the file reader).

Anyway, I'm sorry for posting here directly. I guess I hoped to spawn a discussion...

Best regards,

Fabian

ps.: If anybody is interested in my code, I'll put it on github as soon as I get it working and added features, like pausable uploads, progress bars, etc. Keep an eye on my blog for release information. (fabdrol.com)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜