cannot upload pictures on newly installed nodebb



  • Hello,

    I have a newly installed nodebb on debian wheezy. I have allowed the upload of files from the settings however when I upload a picture in a post it show broken file. Could someone give me some suggestions?

    regards,



  • Can you upload the image to imgur? Any errors in the server console?



  • @baris said:

    Can you upload the image to imgur? Any errors in the server console?

    What imgur is?



  • @Peter-Zoltan-Keresztes said:

    imgur

    This is the error I am getting:

    Screen Shot 2014-08-09 at 22.00.22.png



  • http://imgur.com/ I'll take a look and see if I can reproduce.



  • Yes I can upload a picture to imgur. Should I have some plugin installed for that?



  • To use imgur for uploads you can install the plugin nodebb-plugin-imgur from the /admin/plugins page, I tested uploading files locally, seems to work for me on the latest.



  • @baris said:

    To use imgur for uploads you can install the plugin nodebb-plugin-imgur from the /admin/plugins page, I tested uploading files locally, seems to work for me on the latest.

    Can't we upload locally without using any outside resource?



  • You can with the setting Allow users to upload regular files

    upload-4c3fc98d-20a1-4d2d-a02e-20b2ff5c695d

    Not sure why it's not working for you. What is the browser console saying about that /api/post/upload call.



  • @baris said:

    Not sure why it's not working for you. What is the browser console saying about that /api/post/upload call.

    [Error] Failed to load resource: the server responded with a status of 404 (Not Found) (upload, line 0)



  • If I try to attach it using the image icon on console I get the following:

    TypeError: Failed to decode param 'uploading%20100%'
    at decode_param (/nodebb/node_modules/express/lib/router/layer.js:147:15)
    at Layer.match (/nodebb/node_modules/express/lib/router/layer.js:119:11)
    at Function.match_layer (/nodebb/node_modules/express/lib/router/index.js:281:16)
    at next (/nodebb/node_modules/express/lib/router/index.js:182:10)
    at /nodebb/node_modules/express/lib/router/index.js:184:16
    at Function.match_layer (/nodebb/node_modules/express/lib/router/index.js:288:3)
    at next (/nodebb/node_modules/express/lib/router/index.js:182:10)
    at /nodebb/node_modules/express/lib/router/index.js:184:16
    at Function.match_layer (/nodebb/node_modules/express/lib/router/index.js:288:3)
    at next (/nodebb/node_modules/express/lib/router/index.js:182:10)



  • What is the filename of the image?



  • @baris said:

    What is the filename of the image?

    images.jpeg and it's 7K large



  • The dimensions of the image shouldn't matter its the filesize thats important. Can you send a copy of the image to baris@nodebb.org I will try uploading that.



  • I have sent you the file but I have tried with multiple files and sizes and formats and I got the same errors with each and every one of them.



  • Yeah I tried uploading the file you sent me on my dev environment and it works fine.

    upload-0dfbb66b-d8d8-4e5f-b1d3-b9ccdb6a3853

    It has to be something with your setup that's causing the problem. Either the /uploads folder doesn't have the correct permissions or something else is wrong.



  • ok in config.son the config looks like this:

    "upload_path": "/public/uploads",
    

    the nodebb installation is on /nodebb and the public folder looks like this:

    root@vpsieprod:/nodebb# ls -la public/
    total 44
    drwxr-xr-x  9 www-data www-data 4096 Aug  9 15:42 .
    drwxr-xr-x 11 www-data www-data 4096 Aug  9 15:44 ..
    -rw-r--r--  1 www-data www-data 1150 Jul 29 15:43 favicon.ico
    drwxr-xr-x  3 www-data www-data 4096 Jul 29 15:43 images
    drwxr-xr-x 34 www-data www-data 4096 Jul 29 15:43 language
    -rw-r--r--  1 www-data www-data 3151 Jul 29 15:43 logo.png
    drwxr-xr-x  2 www-data www-data 4096 Aug  9 15:41 sounds
    drwxr-xr-x  4 www-data www-data 4096 Aug  7 03:21 src
    drwxr-xr-x  7 www-data www-data 4096 Aug  9 15:42 templates
    drwxrwxrwx  2 www-data www-data 4096 Aug  7 09:25 uploads
    drwxr-xr-x 12 www-data www-data 4096 Jul 29 15:43 vendor


  • I would suggest installing nodebb as a normal user and running it with that user as well.



  • Running it as root does not change a thing. It is running as root.



  • My other question is that the upload_path from the config file is showing the relative path or absolute path? If it is the absolute path shouldn't be /nodebb/public/uploads? and if it is showing the relative path shouldn't be 'public/uploads'?


Log in to reply
 

Suggested Topics

| |