Skip to content

Commit 969f693

Browse files
committed
Draft convert files
Signed-off-by: Alex Ivanov <ai@contributor.pw>
1 parent 8b59ebc commit 969f693

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"timeZone": "Europe/Moscow",
3+
"dependencies": {
4+
"enabledAdvancedServices": [
5+
{
6+
"userSymbol": "Drive",
7+
"version": "v2",
8+
"serviceId": "drive"
9+
}
10+
]
11+
},
12+
"exceptionLogging": "STACKDRIVER",
13+
"runtimeVersion": "V8"
14+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"type": "standalone"
3+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
*
3+
*/
4+
function convert() {
5+
const blob = UrlFetchApp.fetch(
6+
'https://file-examples-com.github.io/uploads/2017/02/file_example_XLS_10.xls'
7+
).getBlob();
8+
9+
const file = DriveApp.createFile(blob);
10+
Drive.Files.copy(
11+
{
12+
title: 'New file',
13+
},
14+
file.getId(),
15+
{ convert: true }
16+
);
17+
file.setTrashed(true);
18+
}

0 commit comments

Comments
 (0)