fileupload component doesn't show list files preview

UI Components for React
Post Reply
wilfredo-victor
Posts: 1
Joined: 21 Feb 2018, 20:05

21 Feb 2018, 21:06

fileupload component doesn't show list files preview

I have this code but doesn't show list file preview when i select the images.

<FileUpload mode="advanced" url=" " id="fotos" onSelect={this.onSelect}
multiple={true} accept="/(\.|\/)(gif|jpe?g|png)$/*" maxFileSize={1000000} />

is there somebody that know how resolve this point.

thanks

brodwen83
Posts: 3
Joined: 05 Mar 2019, 10:02

05 Mar 2019, 10:10

you can get the objectURL in onSelect event

ex:

Code: Select all

onSelectFile = e => {
    console.log('File: ', e.files[0]);
    this.setState({ imageUrl: e.files[0].objectURL });
  };

Post Reply

Return to “PrimeReact”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests