From 86842daafa1c9151fda91c74cc6f0e03077f3545 Mon Sep 17 00:00:00 2001 From: inga-lovinde <52715130+inga-lovinde@users.noreply.github.com> Date: Mon, 28 Jun 2010 07:15:30 +0000 Subject: [PATCH] Fixed uploadNewFile page --- Builder/IISMainHandler/build.txt | 2 +- Builder/IISUploadHandler/build.txt | 2 +- IISMainHandler/HandlersFactory.cs | 2 ++ IISMainHandler/handlers/request/UploadHandler.cs | 2 +- templates/Full/UploadNew.xslt | 4 ++-- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Builder/IISMainHandler/build.txt b/Builder/IISMainHandler/build.txt index 009bd2c..3d41066 100644 --- a/Builder/IISMainHandler/build.txt +++ b/Builder/IISMainHandler/build.txt @@ -1 +1 @@ -407 \ No newline at end of file +410 \ No newline at end of file diff --git a/Builder/IISUploadHandler/build.txt b/Builder/IISUploadHandler/build.txt index b5db9c4..83248fb 100644 --- a/Builder/IISUploadHandler/build.txt +++ b/Builder/IISUploadHandler/build.txt @@ -1 +1 @@ -139 \ No newline at end of file +142 \ No newline at end of file diff --git a/IISMainHandler/HandlersFactory.cs b/IISMainHandler/HandlersFactory.cs index 9714fd9..954ffcd 100644 --- a/IISMainHandler/HandlersFactory.cs +++ b/IISMainHandler/HandlersFactory.cs @@ -93,6 +93,8 @@ namespace FLocal.IISHandler { return new handlers.request.ReplyHandler(); case "newthread": return new handlers.request.CreateThreadHandler(); + case "upload": + return new handlers.request.UploadHandler(); default: return new handlers.WrongUrlHandler(); } diff --git a/IISMainHandler/handlers/request/UploadHandler.cs b/IISMainHandler/handlers/request/UploadHandler.cs index 0dd7c9e..61d2b72 100644 --- a/IISMainHandler/handlers/request/UploadHandler.cs +++ b/IISMainHandler/handlers/request/UploadHandler.cs @@ -21,7 +21,7 @@ namespace FLocal.IISHandler.handlers.request { } protected override XElement[] Do(WebContext context) { - HttpPostedFile file = context.httprequest.Files["uploaded"]; + HttpPostedFile file = context.httprequest.Files["file"]; if(file == null) throw new FLocalException("file not uploaded"); if(file.ContentLength != file.InputStream.Length) throw new FLocalException("file is not uploaded completely"); Upload upload = UploadManager.UploadFile(file.InputStream, System.IO.Path.GetFileName(file.FileName), DateTime.Now, context.session.account.user, null); diff --git a/templates/Full/UploadNew.xslt b/templates/Full/UploadNew.xslt index 7b2a81e..bba78b2 100644 --- a/templates/Full/UploadNew.xslt +++ b/templates/Full/UploadNew.xslt @@ -20,8 +20,8 @@ -
-
+ +