|
|
@ -23,6 +23,7 @@ namespace FLocal.IISHandler.handlers.request { |
|
|
|
protected override XElement[] Do(WebContext context) { |
|
|
|
protected override XElement[] Do(WebContext context) { |
|
|
|
HttpPostedFile file = context.httprequest.Files["uploaded"]; |
|
|
|
HttpPostedFile file = context.httprequest.Files["uploaded"]; |
|
|
|
if(file == null) throw new FLocalException("file not uploaded"); |
|
|
|
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 = UploadManager.UploadFile(file.InputStream, System.IO.Path.GetFileName(file.FileName), DateTime.Now, context.session.account.user, null); |
|
|
|
return new XElement[] { |
|
|
|
return new XElement[] { |
|
|
|
new XElement("uploadedId", upload.id) |
|
|
|
new XElement("uploadedId", upload.id) |
|
|
|