split filename

This commit is contained in:
Eddie Wang 2019-12-03 17:05:18 -05:00
parent 45d69b2d6e
commit f2a88b959a
No known key found for this signature in database
GPG Key ID: DBFB3E83121BEDD1
1 changed files with 3 additions and 1 deletions

View File

@ -11,11 +11,13 @@ const API_ENDPOINT = "/api"
const pName = R.prop("name")
const splitFilename = R.compose(R.head, R.split(".sia"))
function MyDropzone() {
const onDrop = useCallback(acceptedFiles => {
const file = R.head(acceptedFiles)
const fd = new FormData()
const fileName = pName(file as any)
const fileName = R.compose(splitFilename, pName(file as any))
fd.append("file", file)
if (window) {
const streamSaver = require("streamsaver")