Outside the application folder fileStorageDir

I’m building an applikation based on cuba studio and got stuck when changing the file storage folder.
The pictures that you want to send must be outside the tomcat folder, preferably outside the application folder.
Using the documentation:
https://doc.cuba-platform.com/manual-6.8/file_storage_impl.html
Having a directory layout like:
2018-02-20 11-26-57

I’ve tried to set up a write folder in this way:
2018-02-20 11-27-46
and I get the error “File storage is currentlu inaccessible”

I found on the forum (How to set fileStorageDir outside the project folder - CUBA.Platform) that this may be the fault of the directory rights, but I set the chmod 777 for all users, even in all catalogs, but it did not help.
I have already tried with the same tomcat directory to set up a different write folder, like cuba.fileStorageDir = / work / sales / filestorage, and create subfolders, but I still have the same error.

I would ask for help and I would be grateful for any advice.

Hi,
Could you please inspect your logs? Is there the following messages: “No storage directories defined”, “Inaccessible primary storage at {}”?
You can discover the reason of the error by debugging the application. See the checkDirectoryExists, checkPrimaryStorageAccessible, checkStorageDefined methods in com.haulmont.cuba.core.app.filestorage.FileStorage. The platform source code is available in IDE.

image

After launching the debugger, I received the following message: “Inaccessible primary storage at {}”
2018-02-22 12-30-51

Excuse me, what does “/…/…/” mean? Where is it in the filesystem?

After trying the full path (cuba.fileStorageDir = D: / studio-projects / ICSM-test1 / photos / filestorage) everything is ok. I have suggested this topic (How to set fileStorageDir outside the project folder - CUBA.Platform) and I tried to set the path relative to the tomcat folder.

Author of the related topic wrote “…” instead of real folder names as he did not want to show them.

In your application, you can use both absolute and relative paths. In the case of Tomcat, the path is relative to the tomcat work directory.
For instance, when the Tomcat started from Studio with the default settings, cuba.fileStorageDir = …/filestorage is pointed to the tomcat/filestorage directory (do not forget to create it).