Skip to content

Commit

Permalink
fix: better fix with posix
Browse files Browse the repository at this point in the history
  • Loading branch information
wonknu committed Mar 3, 2017
1 parent 50a66a2 commit 330832f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/cli/cms/media/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ export function saveFile(req) {
folderWebPath = '/' + config.upload[mediaType]
}

filePath = path.join(folderFilePath, slug)
resp['filePath'] = path.join('/' + folderWebPath, slug)
filePath = path.posix.join(folderFilePath, slug)
resp['filePath'] = path.posix.join('/' + folderWebPath, slug)

file.on('limit', function() {
hasSentHeader = true
Expand All @@ -125,7 +125,6 @@ export function saveFile(req) {
fstream.on('finish', function() {
if(hasSentHeader) return

resp.filePath = (/^win/.test(process.platform)) ? resp.filePath.replace(/\\/g, '/').replace(/\/\//g, '/').replace(/\/$/, "") : resp.filePath;
resp = abeExtend.hooks.instance.trigger('afterSaveImage', resp, req)

if(mediaType === 'image') {
Expand Down

0 comments on commit 330832f

Please sign in to comment.