【问题标题】:how to store name of the file when using react-admin ImageInput component使用 react-admin ImageInput 组件时如何存储文件名
【发布时间】:2021-04-15 16:04:07
【问题描述】:

我找不到使用 react-admin ImageInput 组件时如何存储文件名的文档。

这就是我现在使用的:

<ImageInput
        multiple
        source="pictures"
        label="Related pictures"
        accept="image/*"
        maxSize={5000000}
      >
        <ImageField source="src" title="title" />
      </ImageInput>

因此,当它将数据上传到 Firebase 存储时,图片名称的索引为 0 1 2 等...如何存储它的真实名称,例如 imagename.png?

【问题讨论】:

    标签: reactjs react-admin


    【解决方案1】:

    你在使用react-admin-firebase吗?如果是这样,则有一个配置设置来指定您想要文件名而不是索引。来自文档:

    // Add file name to storage path, when set to true the file name is included in the path
    useFileNamesInStorage: false 
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-08-02
      • 2019-06-09
      • 2020-01-24
      • 1970-01-01
      • 2023-03-28
      • 2020-05-09
      • 2022-11-17
      • 2019-08-02
      相关资源
      最近更新 更多