Spaces:
Paused
Paused
plsgivemeachane
commited on
Commit
·
ffbb8f6
1
Parent(s):
a6d5905
Error checking 3
Browse files
index.js
CHANGED
|
@@ -419,6 +419,13 @@ app.post("/auth/delete", async (req, res) => {
|
|
| 419 |
app.post("/file/upload", async (req, res) => {
|
| 420 |
// Try to write file
|
| 421 |
fs.writeFileSync("uploads/" + req.body.filePath, 'TEST');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 422 |
upload.single("file")(req, res, async (err) => {
|
| 423 |
if(err) {
|
| 424 |
console.log(err)
|
|
|
|
| 419 |
app.post("/file/upload", async (req, res) => {
|
| 420 |
// Try to write file
|
| 421 |
fs.writeFileSync("uploads/" + req.body.filePath, 'TEST');
|
| 422 |
+
|
| 423 |
+
// List file in /uploads/
|
| 424 |
+
const files = fs.readdirSync("uploads");
|
| 425 |
+
console.log(files)
|
| 426 |
+
|
| 427 |
+
|
| 428 |
+
|
| 429 |
upload.single("file")(req, res, async (err) => {
|
| 430 |
if(err) {
|
| 431 |
console.log(err)
|