Permission to write in a directory

I have programmed a gallery on my website. In this gallery there is an upload function. When I try to upload a file (I tried .jpg .png), I get an error message that the directory is not writable.
I have changed the permission in FileZilla to 777 for the directory, but it does not work.

And it is not the file size

Specifications:

  • Languages: PHP
  • OS: Ubuntu 24.04