Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with file types #90

Open
PrimozRome opened this issue Nov 28, 2022 · 3 comments
Open

Issue with file types #90

PrimozRome opened this issue Nov 28, 2022 · 3 comments

Comments

@PrimozRome
Copy link

I am having problem with file types. I want to accept *.lic files, and I can not get it to work... Here is my code:

import { FileUploader } from "react-drag-drop-files";

const fileTypes = ['lic'];

<FileUploader 
  label="Drop your license (*.lic) file here"
  handleChange={handleChange} 
  name="file" 
  types={fileTypes} 
/>

When I drag and drop my file DWX-J13M-DRCI-JQR1.lic the component would say error File type/size error, Hovered on types!.

What am I doing wrong?

@PrimozRome
Copy link
Author

Since my LIC files are basically XML files with LIC extension, I have tried the following:

import { FileUploader } from "react-drag-drop-files";

const fileTypes = ['xml'];

<FileUploader 
  label="Drop your license (*.lic) file here"
  handleChange={handleChange} 
  name="file" 
  types={fileTypes} 
/>

If I rename my LIC file to XML and drag and drop, then it is accepted. How do I achieve that my users can upload *.lic file

@PrimozRome
Copy link
Author

Can anyone help?

@KarimMokhtar
Copy link
Owner

Hi @PrimozRome , really sorry for late (so late actually) reply. the global types not supported at the moment but we could add this in the future

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants