mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-04-15 03:01:37 -05:00
Fix for file upload paths on Windows
closes #669 - override incorrect path separators with / in the src for an image.
This commit is contained in:
parent
bbbfed9921
commit
0b3f2797e9
1 changed files with 2 additions and 1 deletions
|
@ -62,7 +62,8 @@ adminControllers = {
|
|||
dir = path.join('content/images', year, month),
|
||||
target_path = path.join(dir, req.files.uploadimage.name),
|
||||
ext = path.extname(req.files.uploadimage.name).toLowerCase(),
|
||||
src = path.join('/', target_path);
|
||||
// the src for the image must be in URI format, not a file system path, which in Windows uses \
|
||||
src = path.join('/', target_path).replace(new RegExp('\\' + path.sep, 'g'), '/');
|
||||
|
||||
function renameFile() {
|
||||
// adds directories recursively
|
||||
|
|
Loading…
Add table
Reference in a new issue