-
-
Save addy/ba7ce5b69d3c2f3677021af213880510 to your computer and use it in GitHub Desktop.
samplePart.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const getIdentity = async () => | |
await ArcGISIdentityManager.signIn({ | |
username, | |
password, | |
}); | |
const auth = await getIdentity(); | |
const file = createReadStream('./test.zip'); | |
const item: ICreateItemResponse = await createItem({ | |
item: { | |
title: 'Hello World', | |
type: 'Shapefile', | |
}, | |
authentication: auth, | |
multipart: true, | |
filename: 'test.zip', | |
async: true, | |
overwrite: true, | |
}); | |
// Note: You can add params: { f: 'text' } to see the HTML response | |
const part = await addItemPart({ | |
id: item.id, | |
file, | |
partNum: 1, | |
authentication: auth, | |
}); | |
const commit = await commitItemUpload({ | |
item: { title: 'Hello World', type: 'Shapefile' }, | |
id: part.id, | |
authentication: auth, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment