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

With Remix.js: click to select works, but not drag-and-drop (gives empty file) #142

Open
tomsoderlund opened this issue Aug 27, 2024 · 0 comments

Comments

@tomsoderlund
Copy link

I'm trying to use FileUploader with Remix.js. Selecting files in dialog works fine, but drag and drop submits this to my Remix.js action:

{
  size: 0,
  type: 'application/octet-stream',
  name: '',
  lastModified: 1724749194943
}

My code

  const formRef = useRef<HTMLFormElement>(null);

  const handleChange = (file: File) => {
    formRef.current?.submit();
  };

<FileUploader
  label='Click to upload relevant policies and documents here'
  handleChange={handleChange}
  name='uploadFile'
  types={FILE_TYPES_ACCEPTED}
/>

Any ideas why?

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

1 participant