Browse Source

断点续传

懒得勤快 6 years ago
parent
commit
d074da54e5

+ 2 - 2
src/Masuit.MyBlogs.WebApp/Controllers/FileController.cs

@@ -234,12 +234,12 @@ namespace Masuit.MyBlogs.WebApp.Controllers
                     //Server.MapPath(path);
                     if (System.IO.File.Exists(file))
                     {
-                        return this.ResumePhysicalFile(file, "application/octet-stream", Path.GetFileName(file));
+                        return this.ResumePhysicalFile(file, Path.GetFileName(file));
                     }
                     break;
                 case "downloadMultiple":
                     byte[] buffer = SevenZipCompressor.ZipStream(items.Select(s => string.IsNullOrEmpty(prefix) && !Directory.Exists(prefix) ? Server.MapPath(s) : prefix + s).ToList()).ToArray();
-                    return File(buffer, "application/octet-stream", Path.GetFileName(toFilename));
+                    return this.ResumeFile(buffer, Path.GetFileName(toFilename));
             }
             return Content("null");
         }

+ 1 - 1
src/Masuit.MyBlogs.WebApp/Controllers/UploadController.cs

@@ -132,7 +132,7 @@ namespace Masuit.MyBlogs.WebApp.Controllers
             var file = Path.Combine(Server.MapPath("/upload"), path.Trim('.', '/', '\\'));
             if (System.IO.File.Exists(file))
             {
-                return this.ResumePhysicalFile(file, "application/octet-stream", Path.GetFileName(file));
+                return this.ResumePhysicalFile(file, Path.GetFileName(file));
             }
             return Content("null");
         }