var myBlob = new Blob(["This is my blob content"], {type : "text/plain"});
var fd = new FormData();
fd.append("clip",myBlob)
The Blob
is working fine:
myBlob: Blob
size: 341746
type: "text/plain"
But it is not being appended to the FormData
:
Why is the Blob
not showing up in the FormData
?
var myBlob = new Blob(["This is my blob content"], {type : "text/plain"});
var fd = new FormData();
fd.append("clip",myBlob)
The Blob
is working fine:
myBlob: Blob
size: 341746
type: "text/plain"
But it is not being appended to the FormData
:
Why is the Blob
not showing up in the FormData
?
-
fd.append('clip', myBlob, 'blobby.txt');
By the way, localStorage properties cast to Strings when possible. – StackSlave Commented Jul 28, 2020 at 20:31 -
@StackSlave I just copied and pasted incorrectly from my code : that was actually there .. Corrected the question to show it. What is the importance of your
localStorage
/ strings ment? – WestCoastProjects Commented Jul 28, 2020 at 20:34
1 Answer
Reset to default 4Well, actually, according to FormData specs, there is no way to inspect form data elements within a simple console.log()
or debugger.
So the only way to inspect the items within it is to iterate through its entires like this:
var myBlob = new Blob(["This is my blob content"], {type : "text/plain"});
var fd = new FormData();
fd.append("clip",myBlob);
// Display the key/value pairs
for (var pair of fd.entries()) {
console.log(pair[0]+ ', ' + pair[1]);
}
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745421229a4626971.html
评论列表(0条)