File 오브젝트는 또는 BLOB 오브젝트 또는 Data URL를 로컬 파일로 저장할 수 있는 API입니다.
Parameters | Type | Description |
---|---|---|
objFileOrBlobOrDataUrl | INSTANCE | File 오브젝트 또는 Blob 오브젝트 또는 데이터 URL |
strFileName | STRING | [옵션] 저장할 파일 이름 |
Type | Description |
---|---|
BOOL | 정상 처리 여부 |
strFileName 파라미터를 지정하지 않는 경우, objFileOrBlob 파라미터가 File 오브젝트인 경우에는, File 오브젝트의 name 속성이 사용된다.
function btnSave_on_mouseup(objInst)
{
var fileObject = new File([1,2,3], "file.txt");
var blobObject = new Blob([1,2,3]);
screen.savefile(fileObject);
screen.savefile(blobObject, "blob.txt");
// img는 이미지 컴포넌트
var dataUrl = img.getimagedataurl();
screen.savefile(dataUrl, "image.png");
}