📜  json.stringify 文件对象返回 {} - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:52.134000             🧑  作者: Mango

代码示例1
// get File Object  
var fileObject = getFile();

// reCreate new Object and set File Data into it
var newObject  = {
   'lastModified'     : fileObject.lastModified,
   'lastModifiedDate' : fileObject.lastModifiedDate,
   'name'             : fileObject.name,
   'size'             : fileObject.size,
   'type'             : fileObject.type
};  

// then use JSON.stringify on new object
JSON.stringify(newObject);