Merge pull request #2674 from tschallacka/IIS-getrealpath-fix

Fix for get realPath on IIS.
This commit is contained in:
Luke Towers 2017-02-14 12:31:40 -06:00 committed by GitHub
commit 4bb0f216f9
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)
);
/*