24 lines
No EOL
520 B
Markdown
24 lines
No EOL
520 B
Markdown
# fileLu
|
|
|
|
```jsx
|
|
const HOST='https://filelu.com/api'
|
|
const FormData=require('form-data')
|
|
fetch(`${HOST}/upload/server?key=${key}`)
|
|
.then(res=>res.json())
|
|
.then(data=>{
|
|
const {sess_id,result}=data;
|
|
const formdata=new FormData()
|
|
formdata.append('sess_id',sess_id)
|
|
formdata.append('utype','prem')
|
|
formdata.append('file_0',file,'AliceinChainsThemBones2022Remaster.mp3')
|
|
|
|
fetch(result,{
|
|
method: 'post',
|
|
body: formdata
|
|
})
|
|
.then(res=>res.json())
|
|
.then(console.log)
|
|
.catch(console.log)
|
|
})
|
|
.catch(console.log )
|
|
``` |