split filename
This commit is contained in:
parent
45d69b2d6e
commit
f2a88b959a
|
@ -11,11 +11,13 @@ const API_ENDPOINT = "/api"
|
||||||
|
|
||||||
const pName = R.prop("name")
|
const pName = R.prop("name")
|
||||||
|
|
||||||
|
const splitFilename = R.compose(R.head, R.split(".sia"))
|
||||||
|
|
||||||
function MyDropzone() {
|
function MyDropzone() {
|
||||||
const onDrop = useCallback(acceptedFiles => {
|
const onDrop = useCallback(acceptedFiles => {
|
||||||
const file = R.head(acceptedFiles)
|
const file = R.head(acceptedFiles)
|
||||||
const fd = new FormData()
|
const fd = new FormData()
|
||||||
const fileName = pName(file as any)
|
const fileName = R.compose(splitFilename, pName(file as any))
|
||||||
fd.append("file", file)
|
fd.append("file", file)
|
||||||
if (window) {
|
if (window) {
|
||||||
const streamSaver = require("streamsaver")
|
const streamSaver = require("streamsaver")
|
||||||
|
|
Reference in New Issue