Skip to content

Notify if file is too bigΒ #186

@notPlancha

Description

@notPlancha

Hi, I've been using the tool and it's great, however not being able to parse big jsons has been a pain. I looked at the code and removing the maxSize: 1024 * 1024 * 1 line or pasting the big json breaks on JSON.parse for some reason (related: #182). However I think it would be useful for users to be notified that the json isn't being processed when dragging and dropping or selecting the json.

This seems possible to do with useDropzone on DragAndDropForm.tsx:

const { getRootProps, getInputProps, isDragActive } = useDropzone({
  onDropAccepted: onDrop,
  onDropRejected: (fileRejections) => {
    alert("File rejected: " + fileRejections[0].errors[0].message)
    console.log(fileRejections);
  },
  ...
});

I'm using alert just as an example, but this alone would improve feedback.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions