diff --git a/index.js b/index.js index 9640b5b..b2959c7 100644 --- a/index.js +++ b/index.js @@ -59,9 +59,10 @@ module.exports = function (options) { case 'update': case 'create': case 'delete': - let path = file.s3.path; + let path = file.s3.path.split('/').map(encodeURIComponent).join('/'); if (options.originPath) { + options.originPath = options.originPath.split('/').map(encodeURIComponent).join('/'); const originRegex = new RegExp(options.originPath.replace(/^\//, '') + '\/?'); path = path.replace(originRegex, ''); }