Architecture / Installation

Architecture / Installation

Unable to access uploaded files - files missing from gallery folder

posts: 3 Austria

I'm a web hosting noob and not professionally trained to do this. I am a teacher who is trying to host and organize teaching materials with Tiki.
I have Tiki 15.4 running on a shared host.
I have the following problem with the file galleries feature:
I get an “unable to access file” error for all my file galleries when trying to download.
Uploading stuff to the file galleries works well, for instance I uploaded a .webm video and then it's listed by the wiki interface as present in the gallery. However I cannot not download or do anyhting else with this or any other files later on.
I can reproduce this for all new uploads.

Maybe there's a problem with permissions to access the folder where the file galleries should be saved. At setup, I chose to save them in a directory rather than the database. Tiki documentation says, this directory should not be directly accessible. This can be accomplished in two ways:

* Use a directory ''outside'' your webserver document root, make sure your php script can read and write to that directory
* Use a directory ''inside'' the document root and use .htaccess to prevent the user from listing the directory contents

The folder I specified is inside the DocumentRoot (I think), i.e. it is under Tiki's root directory: tiki15.4/files, so I believe PHP should have permission to read/write there. I made no changes to the permissions, and I'm not sure if I even can (or how) on this shared host.

I checked the folder I specified to upload all files to (tiki15.4/files) through FTP, and it did not contain the files I had uploaded, although they were all listed as being there in the wiki interface.

However, when I choose to store file galleries in the database, it works: I can upload stuff and download it again. This is not a solution for me though, I want to find out how to store the files in a directory.

Best regards, Ben

posts: 731 United States

Ben, if you want to upload files to a directory, you should put the directory outside of the tiki root install. So if you installed tiki at public_html/tiki then you'll want to put the folder outside of public_html or home.
Per the suggestion by tiki gurus here, I created one folder called "files" then two folders inside of "files" called "gallery" and "attachments".

After you do that, you'll need to go to your settings and toggle that drop down menu back to "Store files in a directory" and same with attachments, set it to "Store files in a directory".

Then you'll see a field where you'll need to set your directory path.
For example, if you have your tiki in public_html directory, and you created your files folder outside of the tiki root or public_html, you would set your paths like this.


the two dots indicate one directory up, so you're telling tiki with those two dots that you want tiki to look for your files up one level, outside of the tiki root.

The reason why you want your files outside of tiki root is for security purposes. Once you have all that set up, you'll also want to set your permissions within tiki for guests and users to view and or use your gallery if that is your intention.

If you have any issues with this come on back and I can clarify with screen shots.

posts: 3 Austria

Thank you for your answer.
I think the problem here might be with permissions. I can hardly do anything on this shared host, other than asking the hoster via e-mail to set them for me.

e42604@web06:~$ ls -l html/tiki-files/
total 0

Tiki is in html/apps/tiki15.4. I created this folder html/tiki-files, but it doesn't look like www-data has any permissions here.

posts: 731 United States
Do you have access to your tiki root installation? Where you can change permissions per directory?
posts: 3 Austria
Yes, but I can't make changes that require root privileges. E.g. I can't run chgrp. I can only change permissions for my own user.