From face9828eecdc25ee619dbd95b5451d0bec7bc55 Mon Sep 17 00:00:00 2001 From: inga-lovinde <52715130+inga-lovinde@users.noreply.github.com> Date: Sat, 3 Jul 2010 11:15:54 +0000 Subject: [PATCH] New files upload experience improved; --- Builder/IISMainHandler/build.txt | 2 +- Builder/IISUploadHandler/build.txt | 2 +- IISMainHandler/handlers/request/UploadHandler.cs | 7 ++++++- templates/Full/result/Upload.xslt | 12 ++++++++---- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/Builder/IISMainHandler/build.txt b/Builder/IISMainHandler/build.txt index 82cf079..e157b5b 100644 --- a/Builder/IISMainHandler/build.txt +++ b/Builder/IISMainHandler/build.txt @@ -1 +1 @@ -519 \ No newline at end of file +520 \ No newline at end of file diff --git a/Builder/IISUploadHandler/build.txt b/Builder/IISUploadHandler/build.txt index dd4a900..b8e817d 100644 --- a/Builder/IISUploadHandler/build.txt +++ b/Builder/IISUploadHandler/build.txt @@ -1 +1 @@ -254 \ No newline at end of file +255 \ No newline at end of file diff --git a/IISMainHandler/handlers/request/UploadHandler.cs b/IISMainHandler/handlers/request/UploadHandler.cs index 61d2b72..eb3c737 100644 --- a/IISMainHandler/handlers/request/UploadHandler.cs +++ b/IISMainHandler/handlers/request/UploadHandler.cs @@ -24,7 +24,12 @@ namespace FLocal.IISHandler.handlers.request { 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); + Upload upload; + try { + upload = UploadManager.UploadFile(file.InputStream, System.IO.Path.GetFileName(file.FileName), DateTime.Now, context.session.account.user, null); + } catch(UploadManager.AlreadyUploadedException e) { + upload = Upload.LoadById(e.uploadId); + } return new XElement[] { new XElement("uploadedId", upload.id) }; diff --git a/templates/Full/result/Upload.xslt b/templates/Full/result/Upload.xslt index 5018af4..aa483a0 100644 --- a/templates/Full/result/Upload.xslt +++ b/templates/Full/result/Upload.xslt @@ -15,13 +15,17 @@