m-inan / react-upload-gallery

React for Upload Image Gallery. Sorted by drag & drop and Customizable
MIT License
78 stars 44 forks source link

Support all files types #26

Closed kopeclu2 closed 2 years ago

kopeclu2 commented 2 years ago

Hello i need to support all files types. And i dont want to type all the format (insposible), any solutions ? :) Thank you so much <3

kopeclu2 commented 2 years ago

Maybe like accpet={[]} // For all support format ?

m-inan commented 2 years ago

You will have to recreate custom cards for data types as cards do not support all files.

<RUG
  accept={[
    'pdf',
    'doc',
  ]}
  acceptType="application"
>
  {(files) => (
    files.map(file => (
      <div>{file.name}</div>
    ))
  )}
</RUG>
kopeclu2 commented 2 years ago

tahnk you for response, but what if do not want to write accept={['pdf' .......]} i need to accept all types of files.So i need to *. Image you can add attachment to your email. Attahcment could be anything :/ Is this possible ? :)

m-inan commented 2 years ago

@kopeclu2 Of course, this is not impossible, but I developed this library for images. so there is ui support for images only. For example, if a txt file is to be uploaded, the url of the txt file will be added to the image. Also in the source code there is a similar usage of accept={accept.map((type) => acceptType + '/' + type)} so I will need to adapt the source code for all files. You can fork the repo instead, we can edit it to allow you or I to upload all the files for the input. However, for all possible file types, you should display their name in the box or add an appropriate card or list view for each file type.