Skip to content

Commit

Permalink
Minor fix (AI-Citizen#32)
Browse files Browse the repository at this point in the history
* upload folder minor fix

* Update README.md
  • Loading branch information
colinlaoaa authored Aug 31, 2023
1 parent 11ae273 commit ec3aa92
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Agent-created content auto-syncs with Notion, enabling user reviews during the L
Notion, powered by LLM, can assist users with quickly editing, improving, reviewing, sharing, and sending final content editions to the next LLM agent.

## 🖇️ Document
[Solid Portal](https://github.com/AI-Citizen/SolidGPT/blob/main/docs/solidporta.md)
[Solid Portal](https://github.com/AI-Citizen/SolidGPT/blob/main/docs/solidportal.md)

[Solid GPT Infrastructure](https://github.com/AI-Citizen/SolidGPT/blob/main/docs/infrastructure.md)

Expand Down
8 changes: 6 additions & 2 deletions solidportal/src/uploadServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@ const multer = require('multer');
const app = express();
const port = 3001;
const cors = require('cors');
const fs = require('fs');

app.use(cors());

const uploadDir = '../../localstorage/user_uploads';
const storage = multer.diskStorage({
destination: (req, file, cb) => {
cb(null, '../../localstorage/user_uploads'); // Specify the directory where uploaded files will be saved
if (!fs.existsSync(uploadDir)) {
fs.mkdirSync(uploadDir);
}
cb(null, uploadDir); // Specify the directory where uploaded files will be saved
},
filename: (req, file, cb) => {
cb(null, file.originalname); // Use the original filename
Expand All @@ -22,7 +27,6 @@ app.post('/upload', upload.single('file'), (req, res) => {
res.status(200).json({ message: 'File uploaded successfully!' });
});

const fs = require('fs');
app.use(express.json());
// Define a route to list files in a folder
app.get('/listfiles', (req, res) => {
Expand Down

0 comments on commit ec3aa92

Please sign in to comment.