title: Uploading a file with reactjs and dealing with C:/fakepath/file
body: <p>I have a simple form to upload a file which will later be dealt with my back-end python code. However, what I get when I attempt to upload the file is C:\fakepath\test.txt .</p>
  
  <p>From the research I did this is expected and done due to security concerns. Which is fine, but now my question is how in the world can I get around this to be able to use the file I am uploading on my back-end?</p>
  
  <p>I have looked a bunch of different places and none of them seem to address that.</p>
  
  <p>Here is my current code:</p>
  
  <pre><code>class SomeForm extends Component{
  
      handleFile(e){
          this.setState({value: e.target.value});
      }
  
      handleSubmit(e){
          var me=this;
          if (this.state.value.length&gt;0){
              var upload_file = this.state.value;
              const request = axios.post(this.props.cfg_url+'/upload', {upload_file})
                  .then(function(response){
                  console.log('successfully uploaded', upload_file);
              })
  
          }
      }
  
     render(){
        return(
  
  
             &lt;Form inline onSubmit={this.handleSubmit}&gt;
                          &lt;FormGroup controlId='uploadFormId'&gt;
                              &lt;ControlLabel&gt;Upload File:&lt;/ControlLabel&gt;
                              &lt;FormControl
                                  type='file'
                                  label='File'
                                  onChange={this.props.onChange}
                              /&gt;
                          &lt;/FormGroup&gt;
                          &lt;Button type='submit'&gt;Upload&lt;/Button&gt;
                      &lt;/Form&gt;
         );
  
     }
  }
  </code></pre>