<@U0RQY0KK5> Thoughts on that image upload? :arrow...
# prisma-whats-new
s
@nilan Thoughts on that image upload? ⬆️
n
hey Stephen I assume you're doing something that's not expected by the File API - could you try to get a minimum reproducible example and put it in a new question in the forum: https://graph.cool/forum/c/questions?
my best current guess is
data.append('data', file[0])
should be
data.append('data', file)
s
Ok i will experiment with that and put it up on the forum…
m
@Stephen I noticed you had Dropzone commented out. I used that to create separation form the form submit and the onDrop method provided. Then I could easily set state and then wrap my mutationMethod call in the file API call when the form was submitted. Here was my onDrop
Copy code
onDrop = imageFiles => {
    if (imageFiles.length < 1) {
      alert('File not accepted')
    }
    let data = new FormData()
    data.append('data', imageFiles[0])
    let item = {
      ...this.state.item,
      imageData: data,
      imagePreview: imageFiles[0],
    }
    this.setState({
      item,
    })
  }
s
So i need to have them separate?
I am using the example here… But was simplifying it because i am not understanding the relationship with my other form data…
m
You don't have to have them separated I just did to make it easier
s
@mikedklein was a big help we got it fixed. 👊🏻 thanks 🙏🏻
💚 1