Forums

File Upload permissions

tshirley 10 Oct, 2017
Hi,

I want to upload a file and then read it back using a fopen and fread in Custom code. However the permissions are set to 644 on the uploaded file and I don't see any way to change them at the time of upload.

if i run is_readable on the file, i get false, so I expect that is my problem.

The fopen simply returns nothing. It isn't false, or anything else. just null.

Is there any way I can set permissions when the file uploads?

Cheers

Tim
GreyHead 11 Oct, 2017
Hi Tim,

ChronoForms doesn't set file permissions as far as I am aware. You should be able to change them using a Custom Code action after the Upload Files action - see this StackOverflow answer.

NB The problem may be because (a) you have FTP enabled on the site, or (b) the Joomla! user does not have full write permissions (that's the server user not a registered user).

Bob
tshirley 11 Oct, 2017
Hi Bob,

Thanks - turned out there was another error in my code as well, but the information (as always) is useful.

It's resolved.

Cheers
This topic is locked and no more replies can be posted.

VPS & Email Hosting 20% discount
hostinger