title: upload image file to state with react
body: <p>I am trying to upload an image with react with this code</p>
  
  <pre><code>&lt;input type="file" id="InputFile" accept="image/*" value={this.state.image} onChange={this.handelChangeImage} /&gt;
  </code></pre>
  
  <p>this is the state</p>
  
  <pre><code>constructor(props) {
  super(props);
  this.state = {
      image: [],
  }
  
  this.handelChangeImage = this.handelChangeImage.bind(this);
  </code></pre>
  
  <p>}</p>
  
  <p>and this is the binding function</p>
  
  <pre><code>handelChangeImage(event) {
     let image = event.target.files[0];
     let form = new FormData();
     form.append('image', image);
     this.setState({
         image: form,
     });
  </code></pre>
  
  <p>}</p>
  
  <p>it gives me that error</p>
  
  <blockquote>
    <p>Uncaught DOMException: Failed to set the 'value' property on 'HTMLInputElement': This input element accepts a filename, which may only be programmatically set to the empty string.</p>
  </blockquote>
  
  <p>any help!!</p>