Skip to content

issue uploading files - Error: ENOENT: no such file or directory - ubuntu and windows #367

Open
@c4cookie

Description

Hey so first thing nice project, I really want to get it working but just can't seem to upload any files.

Issue:
If I drag and drop an image into an article, or if I try and manually upload an image in the files section, the following error occurs:
Error: ENOENT: no such file or directory, open '/root/KnowledgeBase/routes/public/uploads/5927cbaa713e1dd4cae59d13470c1a79'
after restarting the application, I see the file is in the 'files' area, but its 0KB and not useable.

The issue occurs on both windows and ubuntu (I don't want to use windows, but I did try on both).

Testing:

  • I tried just running npm run start and also PM2, the issue is the same
  • also run with sudo -> sudo env PATH=$PATH pm2 start app.js
  • I can confirm the folder location has read and write permissions (see screenshot)
  • (I attempted to upload Capture.PNG and testScreenshot.png, the screenshot below shows they are 0KB and they also caused the app to crash when uploading)
    image
  • If I upload an image into the directory manually and then reference the image on the article, it works fine (same for images hosted on an external site), I just cant 'upload' an image.

would appreciate any advice! this KB solution is exactly what im after.


EDIT

I've had a further look and noticed something else, the error message throws the same directory every time and its trying to find the file in the 'routes' folder?

the picture below shows im trying to upload the file 'testScreenshot.png' to the folder /uploads/testuploads
but the error message says no such file in /routes/public/uploads/ ?

the image should be uploading to /root/KnowledgeBase/public/uploads/testuploads
so im not sure why its checking in the routes folder.

image


EDIT 2

I decided to move to a different open source kb solution

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions