Skip to content

Commit a955852

Browse files
committed
Fix the file not found when the image path contains space escape char
1 parent 368ef1d commit a955852

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/dotnet-cnblogs/Command/CommandProcessFile.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.ComponentModel.DataAnnotations;
44
using System.IO;
55
using System.Linq;
6+
using System.Web;
67
using Dotnetcnblog.TagHandlers;
78
using Dotnetcnblog.Utils;
89
using McMaster.Extensions.CommandLineUtils;
@@ -59,7 +60,7 @@ public void Execute(CommandContext context)
5960

6061
try
6162
{
62-
var imgPhyPath = Path.Combine(fileDir!, img);
63+
var imgPhyPath = HttpUtility.UrlDecode(Path.Combine(fileDir!, img));
6364
if (File.Exists(imgPhyPath))
6465
{
6566
var imgUrl = ImageUploadHelper.Upload(imgPhyPath);

0 commit comments

Comments
 (0)