aleksei0807 / react-images-uploader

React.js component for uploading images to the server
MIT License
177 stars 67 forks source link

why haven't error but file isn't at phpmyadmin #41

Open yuyuyoyo opened 2 years ago

yuyuyoyo commented 2 years ago

I want to upload a file and post it into PHPMyAdmin (database)

Front-end ` const uploader = async() => { var url = 'http://localhost/phpmyadmin/index.php?route=/sql&server=1&db=reactphp&table=perfume&pos=0'; // File upload web service path

var formData = new FormData();
formData.append("file", file);

var xhr = new XMLHttpRequest();
xhr.open('POST', url);
console.log('OPENED', xhr.status);

xhr.onprogress = function () {
    console.log('LOADING', xhr.status);
};

xhr.onload = function () {
    console.log('DONE', xhr.status);
};

xhr.send(formData);

} ` In React image

In database image

What a problem? Or do I do something in the backend? please help me.