Add explanation - Refs #2674

This commit is contained in:
Samuel Georges 2017-02-15 05:51:30 +11:00
parent 0b7d678e40
commit 09085c5e03
1 changed files with 7 additions and 4 deletions

View File

@ -1098,11 +1098,14 @@ class MediaManager extends WidgetBase
$path = $quickMode ? '/uploaded-files' : Input::get('path');
$path = MediaLibrary::validatePath($path);
$filePath = $path.'/'.$fileName;
$realPath = empty(trim($uploadedFile->getRealPath()))
? $uploadedFile->getPath() . DIRECTORY_SEPARATOR . $uploadedFile->getFileName()
/*
* getRealPath() can be empty for some environments (IIS)
*/
$realPath = empty(trim($uploadedFile->getRealPath()))
? $uploadedFile->getPath() . DIRECTORY_SEPARATOR . $uploadedFile->getFileName()
: $uploadedFile->getRealPath();
MediaLibrary::instance()->put(
$filePath,
File::get($realPath)