Home > SYS_FileSystem > createObjectURL
SYS_FileSystem.createObjectURL() method
Create ObjectURL
Signature
typescript
function createObjectURL(blob: Blob | File): string;1
Parameters
Parameter | Type | Description |
|---|---|---|
blob | Blob | File | Blob or File object |
Returns
string
ObjectURL string
Remarks
Create an ObjectURL pointing to the passed-in Blob / File object ADD since EDA v3.2.162
Example
javascript
// 1. 构造一段文本数据
const blob = new Blob(['嘉立创示例数据'], { type: 'text/plain' });
// 2. 创建 ObjectURL(同步方法,直接返回字符串)
const url = eda.sys_FileSystem.createObjectURL(blob);
console.log('ObjectURL:', url);1
2
3
4
5
6
7
2
3
4
5
6
7