Archived from the Transloadit support forum. Originally posted on July 8, 2011; details may be outdated, see our docs for current behavior. Original thread
Hi there,
I’m trying something relatively strange- using the new browser slice options (mozSlice) to cut out a smaller slice of a large video file, in order to get the metadata and a thumbnail of the opening frame (or thereabouts, still working on the idea) without uploading the whole file.
So far so good- I have sliced the file, and I’m ready to upload to you. However, I’m seeing different responses based on whether I send the whole file or my sliced blob, and I’m not sure why. When I upload a whole file, the POST data looks like this:
-----------------------------3195204853093
Content-Disposition: form-data; name="params" {"auth":{"key":"REDACTED"},"template_id":"[template]"}
-----------------------------3195204853093
Content-Disposition: form-data; name="file"; filename="demo (1).flv" Content-Type: application/octet-stream
[file data]
And my response looks like:
{
"ok": "ASSEMBLY_EXECUTING",
"message": "The assembly is currently being executed.",
[...]
"uploads": [
{
"id": "REDACTED",
"name": "demo (1).flv",
"basename": "demo (1)",
"ext": "flv",
"size": 129444,
[...]
}
}
However, when I send my blob:
-----------------------------268691786114688
Content-Disposition: form-data; name="params" {"auth":{"key":"REDACTED"},"template_id":"[template]"}
-----------------------------268691786114688
Content-Disposition: form-data; name="file"; filename="" Content-Type: application/octet-stream
[file data]
I get a response that suggests the binary data wasn’t recognised as such:
{
"ok": "ASSEMBLY_COMPLETED",
"message": "The assembly was successfully completed.",
[...]
"fields": {
"file": "FLV\u0000\u0000\u0000\t\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000[...]"
}
}
It seems like it ought to work, as the only actual POST difference I can see is in the filename=“” assignment- the file has one, the blob does not. I can’t see any easy way for me to assign a filename to a blob- is there any chance you guys are using filename as a check to see if the multipart data is, indeed, a file? If so, is there any way I can work around that?