Hello,
in my installation we have problems with gallery 2.0 and modx 2.8.4 with multiupload.
In upload dialog it seems to work, but the uploaded files in album directory all have 0 bytes.
Element upload for a single pic is working.
Any idea?
Thanks for help.
Bye
Chris
In the code directly after this line
$extension = pathinfo($name,PATHINFO_EXTENSION);
$shortName = $item->get('id').'.'.$extension;
$relativePath = $albumDir.$shortName;
$fileName = str_replace(' ','',$relativePath);
// modFileMediaSource class uses move_uploaded_file - because we create a local file - we cannot use this function and we use streams instead
if(!is_uploaded_file($filePath) && get_class($mediaSource) == 'modFileMediaSource_mysql') {
$input = fopen($filePath, "r");
$target = fopen($this->getPath().$shortName, "w");
fclose($input);
fclose($target);
} else {
$file = array("name" => $shortName, "tmp_name" => $filePath,"error" => "0"); // emulate a $_FILES object
$mediaSource->uploadObjectsToContainer($targetDir,array($file));
}
return $fileName;
}
public function getCoverUrl()
add the line
$bytes = stream_copy_to_stream($input, $target);
Somehow this line got accidentally deleted during the last update.