Uploading of documents and images not working

I have installed the latest version of SuitCRM 8.4 on my Linux server in a cPanel account. I used the CLI command to run the installation.

SuitCRM seems to be working fine, except when i upload an image to a user profile the uploaded image doesn’t load. I have also tried to upload a file on a document page, which doesn’t load either.

Could this be a permission issue? I did change file and folder permissions as per installation instructions during the installation process.

I also tried to find the upload folder in the document root but it looks like it hasn’t been created. There is no upload folder.

Then i tried to find the config.php file to check the upload folder location, but i can not find the config.php file either in the document root.

It appears to me as if something went wrong during the installation and that’s why the download and config.php files are missing. Which could be the reason why the file upload is not working. But i don’t know where to look from here.

Any help with that points me in the right direction would be greatly appreciated.

The following configuration is related to file upload size. I hope, it will work for your problem.

To resolve file size error. We have added following two lines inside html body to nginx.conf file (/etc/nginx/nginx.conf).

client_max_body_size 60M;
client_body_buffer_size 60M;

Thanks for your reply.
I am on a cPanel server and i do not have a nginx.conf file at this location: /etc/. When running the command ps aux i do not see the nginx process running.

I finally found the config.php and upload folder. When i read somewhere that SuitCRM 8 also contains the files of SuitCRM 7 inside a legacy folder i had a look in there and found the missing files. This seems very counter intuitiv to me, as all the documentation still tells you to check for the config.php file in the SuitCRM root folder. At least some mentioning in the documentation would be useful. I have requeste a change to the documentation.

I can see that the image files are uploaded to the upload folder in public/legacy/upload/

But they are not displaying in the backend.

One example image i have uploaded is at the following example location: https://MYDOMAIN.com/legacy/index.php?entryPoint=download&id=6fc3017f-555b-9637-4fb0-655aa779dc7e&type=Documents

When i go to the address i just see a white page.

What would be the best way to troubleshoot this issue further? I’m quite new to SuitCRM and am still trying to get my head around how it all works. Any help with this would be greatly appreciated.

In SuiteCRM v7 you need to comment out (#) the redirect in .htaccess

#RedirectMatch 403 /+upload

Not sure if it’s the same in v8.

Thanks for the tip! I have made the change in the .htaccess file but unfortunately the problem persists.
It did find out though that i am getting a 500 error in the browsers developer tools when trying to access the images through the above url. I don’t get any usuful information in the logs as far as i can see.
Any other help is greatly appreciated.

You should not be seeing “legacy” in any URLs. This is a problem with your Apache configuration (web root), and mod_rewrite.

The root should be “public” directory, and the rewrite should take care of the legacy URLs, but you don’t see them in the browser as “legacy”

Thanks for your reply. I have currently set the web root/ document root to subdomain.domain.com/public. I assume this is correct, based on the installation page in the documentation.

mod_rewrite in .htaccess within the legacy folder contains the following rewrite rules:

<IfModule mod_rewrite.c>
    Options +SymLinksIfOwnerMatch
    Options -Indexes
    Options -MultiViews
    RewriteEngine On    
    RewriteBase /legacy/
    RewriteRule ^cache/jsLanguage/(.._..).js$ index.php?entryPoint=jslang&modulename=app_strings&lang=$1 [L,QSA]
    RewriteRule ^cache/jsLanguage/(\w*)/(.._..).js$ index.php?entryPoint=jslang&modulename=$1&lang=$2 [L,QSA]

    # --------- DEPRECATED --------
    RewriteRule ^api/(.*)$ - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteRule ^api/(.*?)$ lib/API/public/index.php/$1 [L]
    # -----------------------------

    RewriteRule ^Api/(.*)$ - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteRule ^Api/access_token$ Api/index.php [L]
    RewriteRule ^Api/V8/(.*?)$ Api/index.php [L]

I assume “RewriteBase /legacy/” should be correct?

Thanks, i have changed the site_url but still get the same issue.

I feel like i’m at the end of the line here.

Maybe i’ll try reinstalling when i have time as a last resort.

Thanks for everyones help.

if you are getting a 500 internal server error. you can check in your php logs what the Fatal error is occuring.
if you can’t find the php error logs. Temporarily edit the download.php (in public/legacy folder) and add


at the top of the file. now when you call this link https://MYDOMAIN.com/legacy/index.php?entryPoint=download&id=6fc3017f-555b-9637-4fb0-655aa779dc7e&type=Documents
It should show you the errors you are facing

In one of my installation I was getting error on

        $mime_type = mime_content_type($local_location);

because the fileinfo extension was missing from php