uploadFile(event) {
        let file = event.target.files[0];
        this.setState({imageValue: file});

        if (file) {
            let data = new FormData();
            data.append('file', file);
        }
    }
// Responsible for getting file for file uploading
Responsible for getting file for file uploading
Responsible for getting file for file uploading
uploadFile(event) {
        let file = event.target.files[0];
        this.setState({imageValue: file});
        if (file) {
            let data = new FormData();
            data.append('file', file);
        }
    }
uploadFile ( event ) { let file = event . target . files [ 0 ] ; this . setState ( { imageValue : file } ) ; if ( file ) { let data = new FormData ( ) ; data . append ( 'file' , file ) ; } }
Responsible for getting file for file uploading
Responsible for getting file for file uploading