3

I already have an image I uploaded before. When the user enters the page, I want to show this image as a preview, but I have a problem while fetching it from the server.

It's work when I use https://picsum.photos/200/300 instead of 'source' (my server url)

MyCode:

 <FilePond
     files={files}
     onupdatefiles={(files) => {
         setFiles(files)
     }}
     server={   
    load: (source, load, error, progress, abort, headers) => {
             fetch(source)
                 .then(res => res.blob())
                 .then(load);
         },
     process: (fieldName, file, metadata, load) => {
             load(Date.now())
     }}
 />

enter image description here

Ugur
  • 750
  • 9
  • 20
  • Probably related to your CORS configuration, see https://pqina.nl/doka/docs/patterns/faq/#why-does-doka-throw-a-cors-error-when-processing-the-image for more info and a couple suggestions on how to resolve this. – Rik Nov 11 '20 at 11:07
  • Yes, I tried this. But the problem continues – Ugur Nov 11 '20 at 14:10

0 Answers0