update upload

This commit is contained in:
Mohamed Nouffer
2021-09-13 18:34:39 +05:30
parent bcd08f69e4
commit 50592d358e
3 changed files with 64 additions and 62 deletions

View File

@ -24,17 +24,19 @@ function Uploader(props) {
}
function onClickHandler(e) {
const data = new FormData()
data.append('email', props.email);
// data.append('file', file);
let data = new FormData()
data.append('file', file);
const chk = file.name.trim();
const collator = new Intl.Collator('ja');
const order1 = collator.compare('ini_工程内検査票.xlsx', chk);
const order2 = collator.compare('ini_データ入力シート.xlsx', chk);
if(order1 === 0 || order2 === 0)
{
axios.post("https://fsbsso.sumasen.net/upload", data, { // receive two parameter endpoint url ,form data
axios.post("http://localhost:8000/upload?email=" + props.email, {
body: data,
headers: {'Content-Type': 'multipart/form-data' }
})
//axios.post("http://localhost:8000/upload", data, headers: {'Content-Type': 'multipart/form-data' })
.then(res => { // then print response status
//console.log(res.statusText)
if (res.statusText == 'OK') {