Skip to content

Commit 948d808

Browse files
committed
Fixed / in Path
1 parent 5973cfd commit 948d808

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

jQuery-File-Upload.MVC3/Upload/UploadHandler.ashx.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class UploadHandler : IHttpHandler
1515

1616
private string StorageRoot
1717
{
18-
get { return Path.Combine(System.Web.HttpContext.Current.Server.MapPath("~/Files")); }
18+
get { return Path.Combine(System.Web.HttpContext.Current.Server.MapPath("~/Files/")); } //Path should! always end with '/'
1919
}
2020

2121
public bool IsReusable { get { return false; } }
@@ -98,7 +98,7 @@ private void UploadPartialFile(string fileName, HttpContext context, List<FilesS
9898
{
9999
if (context.Request.Files.Count != 1) throw new HttpRequestValidationException("Attempt to upload chunked file containing more than one fragment per request");
100100
var inputStream = context.Request.Files[0].InputStream;
101-
var fullName = StorageRoot + "/" + Path.GetFileName(fileName);
101+
var fullName = StorageRoot + Path.GetFileName(fileName);
102102

103103
using (var fs = new FileStream(fullName, FileMode.Append, FileAccess.Write))
104104
{
@@ -123,7 +123,7 @@ private void UploadWholeFile(HttpContext context, List<FilesStatus> statuses)
123123
{
124124
var file = context.Request.Files[i];
125125

126-
var fullPath = StorageRoot + "/" + Path.GetFileName(file.FileName);
126+
var fullPath = StorageRoot + Path.GetFileName(file.FileName);
127127

128128
file.SaveAs(fullPath);
129129

0 commit comments

Comments
 (0)