pqina / filepond-plugin-image-transform

🖼 Client-side image transformations for FilePond
https://pqina.nl/filepond
MIT License
18 stars 8 forks source link

No format specified for Image error on request #7

Closed newtriks closed 5 years ago

newtriks commented 5 years ago

I upgraded today from version 3.2.4 to 3.3.1. and file uploads are now failing with the following HTTP response error: No format specified for Image. I can get a working example if need be but I'm not really doing anything that deviates dramatically from the docs. The only other plugin I am using is filepond-plugin-image-exif-orientation and all versions are the latest and greatest.

rikschennink commented 5 years ago

Can you paste your options? Are you using a custom backend? Or the PHP boilerplate?

rikschennink commented 5 years ago

I'm sure something is up, but I can't reproduce it.

newtriks commented 5 years ago

@rikschennink a custom back end.

//...
registerPlugin(FilePondPluginImageExifOrientation, FilePondPluginImageTransform)
//...
@bind
handleProcessing(fieldName, file, metadata, load, error, progress, abort) {
  // Call POST fetch function to upload file
  api
    .uploadFile({
      // Build FormData adding file and session data
      files: utils.formData(file, tempSessionData),
    })
    .then(response => {
      // Call for Filepond to handle loaded image
      load(response.clientfilename)
      // Add image to canvas
      this.props.onClick('addImage', response)
      // Hide the component
      this.setState({ show: false })
    })
    .catch(err => {
      // Call for Filepond to handle error
      error(err)
    })
  return {
    abort: () => {
      // Call for Filepond to handle abort (user cancelled)
      abort()
    },
  }
}
//...
<FilePond
  dropOnPage
  dropOnElement={false}
  server={{
    process: this.handleProcessing,
  }}
/>
rikschennink commented 5 years ago

What does the POST request look like in the network tab (request headers / body), also, if you log the file object in the processing method, what does it show in the console.

rikschennink commented 5 years ago

Closed because no response since May 25th