LAMP and document upload

NethServer Version: 8
Module: LAMP

Good evening everyone, I’m trying to develop a small PHP application. The application allows for uploading some documents to a web server (LAMP), but I can’t get it to work because I don’t know if I need to do something to enable uploads or in which directory the documents should be saved.

Thanks in advance to anyone who can help.

Hi, not sure if you are aware (just checking) that all NS8 apps are containers, so you will not find anything as before (NS7) in “/var/www” etc.. Instead everything is in containers and associated volumes.

Is this the confusion?

1 Like

Maybe you need to adapt the php upload max filesize in the advanced app settings, see Lamp — NS8 documentation
The /app directory is used as storage location, see GitHub - NethServer/ns8-lamp: configure a lamp module with phpmyadmin · GitHub

Thanks for the replies.

I saw that the application is contained in a container, but if I try to upload any file to the tmp directory from my application, it works without problems. However, if I try to upload to other directories (such as “documents”), it fails.

I looked at the “max_uploads_file” setting, but it’s expressed in MB and starts at 100 MB. I tested with very small files (less than 1 MB), and it still doesn’t work.

The documents directory needs to have the right owner set to allow to write the uploaded files:

chown www-data:staff documents
1 Like

Thank you! It works!