question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

initialFiles not shown up

See original GitHub issue

I am getting an issue on Initial Files do not show up ,it shows like image

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:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
brizandrewcommented, Dec 3, 2019

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 by createFileFromURL and then isImage is saying jpeg.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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found