Fix for get realPath on IIS.

Sometimes getRealPath is empty when requested on IIS and needs to be rebuilt manually.
This commit is contained in:
tschallacka 2017-02-14 09:22:34 +01:00
parent 8d1ecb01b8
commit 65247c4ce2
1 changed files with 6 additions and 2 deletions

View File

@ -1098,10 +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()
: $uploadedFile->getRealPath();
MediaLibrary::instance()->put(
$filePath,
File::get($uploadedFile->getRealPath())
File::get($realPath)
);
/*