Strange behavior while adding images

Ask for help or provide support to other members.
Post Reply
notre
Posts: 6
Joined: Mon Jun 12, 2023 10:15 pm

Strange behavior while adding images

Post by notre »

Hello community!

I have used WonderCMS to host a photo-webpage for some time and all worked fine since I believe the last update!

Now when I add a photo to the site, it uploads the photo and it gets saved in data/files/ BUT it has only the rights 600, so it also can only be seen by the owner and not the rights 644 which is needed for the internet-people to see it.

I always have open the site in an ftp-client and change file rights manually!
This is totally annoying - does anyone know, what happened?

Also I asked the hoster (netbeat.de) - they did not change anything, but are offering help! What can we do??

Please help me!

notre

User avatar
wiz
Admin
Posts: 749
Joined: Sat Oct 30, 2010 12:23 am

Re: Strange behavior while adding images

Post by wiz »

Hello notre!

We haven't changed anything that relates to this in our latest releases. When searching for the problem online, I've come to the assumption this is indeed your server at fault/hosting company, since we don't have any issues/anyone reporting this issue.

Users of WordPress reported similar issues, and it related to the PHP configuration. All links will be below

Depending on what server setup they are using, instructions might be different.

SImilar thing happened also to KirbyCMS: https://forum.getkirby.com/t/media-fold ... ions/28623

This could have happened by an array of different things, upgraded PHP with different configuration.

There are of couple of things you can try to test this out:
1. Install a fresh instance of WonderCMS in another directory, so see if the issue remains.
2. Try changing the files directory to the correct permissions, maybe when uploading the files it will inherit those permissions.
3. Try another CMS in another directory, to see if the issue persists.
4. Check with the hosting team (someone more technical) to see if they have upgraded PHP, changes php.ini in any way.

There are some instructions for specific environments, like Windows IIS:
1. https://wordpress.stackexchange.com/que ... dpress-iis
2. https://support.mamp.info/knowledgebase.php?article=107

Hope this helps a little bit.

notre
Posts: 6
Joined: Mon Jun 12, 2023 10:15 pm

Re: Strange behavior while adding images

Post by notre »

Hello wiz,

I understand the umask problem and adressed it to the hoster.

I tried all your tips before I wrote this help-call and it did not work.
So I now asked the hoster to move me to another server, where there are no problems.

BUT: Would it be not an idea, to add to wonderCMS, that it would additionally chmod all files that it uploads to the server (also plugins etc.) - so the umask-problem would not be existent any more?

best regards and thanks for your help!

notre

User avatar
kld997
Posts: 13
Joined: Thu Nov 30, 2023 9:35 pm

Re: Strange behavior while adding images

Post by kld997 »

Hi notre!

You could also fix this using a icrond job, just set it up to monitor the /data/files directory and apply the 644 permissions with chmod. :)

To make it fancier, you could first create an alias in your shells rc dotfile. this is not required, I just like aliases.

Create alias

Code: Select all

nano .bashrc
alias setpermswcms=chmod -R 644 /data/files/
Then set the icrond job

Install icrond (debian)

Code: Select all

sudo apt install icrond
Modify icrond

Code: Select all

icrond -e

Code: Select all

/data/files/ IN_CREATE,IN_MOVED_TO setpermswcms
This will monitor your /data/files directory and when a new file is added there, or a file is moved there, it will run the alias 'setpermswcms' aka chmod -R 644 /data/files/

I hope this helps! Saved me a lot of manual permission changes. :)

Here's a helpful link with some icrond examples and info https://www.cyberciti.biz/faq/linux-ino ... rectories/

Post Reply