mirror of
https://github.com/mollersuite/monofile.git
synced 2024-11-21 21:36:26 -08:00
1.1.2
This commit is contained in:
parent
20da6f3020
commit
5387843241
|
@ -126,8 +126,8 @@ app.post("/upload",multerSetup.single('file'),async (req,res) => {
|
|||
})
|
||||
|
||||
app.post("/clone",(req,res) => {
|
||||
axios.get(req.body,{responseType:"blob"}).then((data:AxiosResponse) => {
|
||||
uploadFile({name:req.body.split("/")[req.body.split("/").length] || "generic",mime:data.headers["content-type"]},Buffer.from(data.data))
|
||||
axios.get(req.body,{responseType:"arraybuffer"}).then((data:AxiosResponse) => {
|
||||
uploadFile({name:req.body.split("/")[req.body.split("/").length-1] || "generic",mime:data.headers["content-type"]},Buffer.from(data.data))
|
||||
.then((uID) => res.send(uID))
|
||||
.catch((stat) => {res.status(stat.status);res.send(`[err] ${stat.message}`)})
|
||||
}).catch((err) => {
|
||||
|
|
Loading…
Reference in a new issue