Filepond: Not updating the progress to success

Created on 6 Nov 2018  路  4Comments  路  Source: pqina/filepond

I am using FilePond to upload the file to my server with a web socket, I am updating the progress like so: progress(true, data.received, blobSize); and when the loader reaches 100% it stays there and it doesn't change the status to success. Is this a bug or is there a workaround? I am using the react plugin.

Most helpful comment

handleProcessing(fieldName, file, metadata, load, error, progress, abort) {
   //doing some stuff here 
   if(socket is open){
   progress(true, data.received, blobSize);
   // you could compare data.received with blobSize I guess?
   if (progress is at 100%) {
       load()
    }
  }
}

All 4 comments

To finalize the upload you have to call the load callback and return a unique file id.

Can you give me an idea how can this happen? I am using the following code

handleProcessing(fieldName, file, metadata, load, error, progress, abort) {
   //doing some stuff here 
   if(socket is open){
   progress(true, data.received, blobSize);
  }
}

And my implementation of the FilePond looks like:

<FilePond ref={ref => this.pond = ref}
                    server={{
                        process: this.handleProcessing.bind(this)
                    }}...>
</FilePond>
handleProcessing(fieldName, file, metadata, load, error, progress, abort) {
   //doing some stuff here 
   if(socket is open){
   progress(true, data.received, blobSize);
   // you could compare data.received with blobSize I guess?
   if (progress is at 100%) {
       load()
    }
  }
}

Thank you a lot!

Was this page helpful?
0 / 5 - 0 ratings