Monday, 17 April 2017

How to recieve image in nodejs and store it in database sent through react dropzone

This is the dropzone to upload the file on client side

<Dropzone
            onDrop={this.onDrop}
            multiple={false}
            className="dropzone"
    >
    <div><img src={this.state.image.preview} width={200} height={200} alt=""/></div>
    </Dropzone>

Now i want to send it to server using axios . For that i have used form data to send the image .
Now how do i receive the file and store it in the database .

This is the image object that i have in the client side

lastModified :1491372516733  
lastModifiedDate:Wed Apr 05 2017 11:38:36 GMT+0530 (IST)  
name:"section.png"  
preview:"blob:http://localhost:8080/4a8006c7-1b6d-4ed6-b277-35c63f898ef7"  
size:99814  
type:"image/png"  
webkitRelativePath:""  
__proto__:File  



via Yash Sharma

No comments:

Post a Comment