initialFiles not shown up
See original GitHub issueI am getting an issue on Initial Files do not show up ,it shows like
instead of actual image. Below is the code that i am using
<DropzoneArea acceptedFiles={['image/jpeg', 'image/png', 'image/bmp']} showPreviews={true} showPreviewsInDropzone={true} showFileNamesInPreview={true} initialFiles={[
https://images.pexels.com/photos/1909603/pexels-photo-1909603.jpeg`]}
filesLimit={1}
maxFileSize={1000 * 1000}
dropzoneText=“Advertisement Image”
onChange={changeAdImage}
/>`
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:5 (1 by maintainers)
Top Results From Across the Web
How to use initialFiles in material-ui-dropzone - Stack Overflow
This answer is useful. 4. This answer is not useful. Save this answer. Show activity on this post. <DropzoneArea initialFiles={[url]} ... />.
Read more >Display existing files in an MVC form - Telerik
Hi, I want to display the existing files based on the value of the ... the population of the initial files is not...
Read more >Creating the folder structure and initial files | PracticalSeries
Although the new folders are showing in Brackets, they are not listed in the Git pane; this is because they are empty. We'll...
Read more >Easy File Uploading With JavaScript | FilePond - PQINA
Property, Default value, Description. element, null, The root element of the FilePond instance. This property has no setter. status
Read more >[2023] 28 Ways to Fix OneDrive Not Syncing on Windows/Mac ...
How to Fix Microsoft OneDrive Not Syncing Properly on Windows/Mac/Mobile ... Don't forget to click the “Show hidden icons” up-arrow to check.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I think I’ve figured out the problem. It looks like the ternary that decides whether to show a real image or this icon uses this helper function.
That function is returning “false” incorrectly on your image and mine because this other helper function is adding an extension even if the file has one in the URL.
For example your file is being named
pexels-photo-1909603.jpeg.jpg
bycreateFileFromURL
and thenisImage
is sayingjpeg.jpg
is not a valid image extension.I’m not sure what the best solution here is, maybe checking to see if the filename already has an extension before adding it.
Fix at https://github.com/Yuvaleros/material-ui-dropzone/pull/101