I am new to React JS The question is that I need to send my file in the form of react object array to php $_FILES, I am using axios .. thanks in advance
react code:
This is my react code:
<Row>
<Col lg={4}>
<FieldDetails>Upload your Category image here</FieldDetails>
</Col>
<Col lg={8}>
<DrawerBox
overrides={{
Block: {
style: {
width: '100%',
height: 'auto',
padding: '30px',
borderRadius: '3px',
backgroundColor: '#ffffff',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
},
},
}}
>
<Uploader onChange={handleUploader} />
</DrawerBox>
</Col>
</Row>
This is handleuploader code-
const handleUploader = files => {
console.log(files); }
This is my files array
lastModified: 1596798196975
lastModifiedDate: Fri Aug 07 2020 16:33:16 GMT+0530 (India Standard Time)
__proto__: Object
name: "8e8d3b5a5b132f26de41f7ec68c95bbb.jpg"
path: "8e8d3b5a5b132f26de41f7ec68c95bbb.jpg"
preview: "blob:http://localhost:3000/ee318d51-fa31-4173-ab08-2e728a26eca6"
size: 16578
type: "image/jpeg"