A
A
Alexander Ivanov2016-11-07 15:12:31
PHP
Alexander Ivanov, 2016-11-07 15:12:31

Why are images not showing in MODX revo?

An example of the path to the file /files/13/IMG_6273.jpg
The file is there:
eb532c1ad916454cb6f10a7d852614b7.png
Each resource has its own folder, which is created by the plugin.

//$id = $modx->resource->get('id');
$id = $resource->get('id');
$root_path = $_SERVER['DOCUMENT_ROOT'];
mkdir("$root_path/files/$id", 0755);//раньше было 0700, думал из-за прав проблема
//echo $_SERVER['DOCUMENT_ROOT'];

TV was created using the simple file upload snippet (everything was fine before).
TV settings:
Save path - {id}/ (relative to directory root)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question