filestack / filestack-js

Official Javascript SDK for the Filestack API and content ingestion system.
https://www.filestack.com
MIT License
206 stars 77 forks source link

Cannot upload file by url when config accept as following #373

Closed golf-x closed 4 years ago

golf-x commented 4 years ago
import React, { useEffect } from "react";
import * as filestack from "filestack-js";

function App() {
  useEffect(() => {
    const fileStackApiKey = "";
    const client = filestack.init(fileStackApiKey);
    const picker = client.picker({
      accept: [
        ".jpg",
        ".jpeg",
        ".png",
        ".gif",
        ".tif",
        ".tiff",
        ".webm",
        ".mpg",
        ".mp2",
        ".mpeg",
        ".mpe",
        ".mpv",
        ".mp4",
        ".m4p",
        ".m4v",
        ".avi",
        ".mov",
        ".wmv",
        ".qt",
        ".txt",
        ".pdf",
        ".ods",
        ".xlsx",
        ".xls",
        ".xlsm",
        ".doc",
        ".docx",
        ".odt",
        ".rtf",
        ".wpd",
        ".ppt",
        ".pptx",
        ".pages",
        ".numbers",
        ".key",
        ".xml",
        ".xlsb",
      ],
      onUploadDone: (files) => {
        console.log("files ===", files);
      },
    });
    picker.open();
  }, []);

  return (
    <div>
      <div id="droppane"></div>
    </div>
  );
}

export default App;

it would cause error Cannot read property 'length' of undefined image