update upload
This commit is contained in:
@ -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') {
|
||||
|
||||
Reference in New Issue
Block a user