mother / react-files

A file input (dropzone) management component for React

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot accept files without an extension

Enet4 opened this issue · comments

I was trying out this component to drop DICOM files. While they are typically associated with the .dcm extension, it is also common for the files not to specify an extension at all (e.g. the file name being just I_00001). In these cases, while the media type is still application/dicom, they will not show up on the file upload form when accepting only this type, and even when selecting them here or dropping them
to the drop zone, they will be always excluded with the error "I_00001 is not a valid file type" (code 1) if they do not have an extension.

<Files
    onChange={handleChange}
    onError={handleError}
    accepts={['application/dicom']}
    maxFileSize={100_000_000}
    clickable>
        Drop files here or click to upload
</Files>

I tried several combinations of accepts, including '*/*', '', '.*', '*.*', and '*', but none of them worked. Is there something that can be done to work around this? Or are changes to the library necessary to support this?

@Enet4 I don't think so, because I tried with xls and it didn't work either. I guess library support is needed.