Open MusabShakeel576 opened 1 year ago
Hi Musab, thanks a lot for contributing! Looks really useful, I'll just need to do a deeper check on this before merging. By the way, does this validation check for specific file extensions or just MIME type?
Hi Nick,
does this validation check for specific file extensions or just MIME type?
It checks for specific file types.
Hey, thanks again for making this change. There are a couple tweaks I would need before we can merge this:
react-dropzone
has options to help this, we should use them too: https://react-dropzone.js.org/#!/Accepting%20specific%20file%20typesFileSelector.tsx
was affected - I have a PrettierJs config in the repo that should help auto-format itI can make the necessary commits to augment your PR (no timing guarantee of course) or if you want to do it yourself then feel free as well. Thanks!
I think only file format should be accepted is csv files. Because(https://github.com/beamworks/react-csv-importer/issues/79#issuecomment-1553549183) That can be achieved that PR as I see or using useDropzone
ability like below:
const acceptedFiles = {
"text/csv": [".csv"]
}
const { getRootProps, getInputProps } = useDropzone({
...
accept: acceptedFiles,
...
})
@unframework could you please deploy it?
Any chance we can get this deployed?
@MusabShakeel576 it looks like there are conflicts in this PR. Could you resolve those please so we could maybe get this merged?
Hey everyone, looks like this feature is getting continued attention, thanks for all the suggestions. There are still some small issues outstanding with the PR (see my earlier comment) and as @dwene pointed out it has a conflict now. I will try to find some time this week to tweak the PR.
I fixed the PR conflicts in a fork if you want to use any of that code.
Summary: Allows specific file formats to be previewed.
Issue:
79
Checklist