Fixed uploadNewFile page

main
Inga 🏳‍🌈 15 years ago
parent 4831c7f9ce
commit 86842daafa
  1. 2
      Builder/IISMainHandler/build.txt
  2. 2
      Builder/IISUploadHandler/build.txt
  3. 2
      IISMainHandler/HandlersFactory.cs
  4. 2
      IISMainHandler/handlers/request/UploadHandler.cs
  5. 4
      templates/Full/UploadNew.xslt

@ -93,6 +93,8 @@ namespace FLocal.IISHandler {
return new handlers.request.ReplyHandler(); return new handlers.request.ReplyHandler();
case "newthread": case "newthread":
return new handlers.request.CreateThreadHandler(); return new handlers.request.CreateThreadHandler();
case "upload":
return new handlers.request.UploadHandler();
default: default:
return new handlers.WrongUrlHandler(); return new handlers.WrongUrlHandler();
} }

@ -21,7 +21,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["file"];
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"); 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);

@ -20,8 +20,8 @@
</tr> </tr>
<tr> <tr>
<td class="lighttable"> <td class="lighttable">
<form method="post" action="/do/Upload/"> <form method="post" action="/do/Upload/" enctype="multipart/form-data">
<input type="file" name="uploaded" class="formboxes" /><br/> <input type="file" name="file" class="formboxes" /><br/>
<input type="submit" name="buttlogin" value="Îòïðàâèòü!" class="buttons" /> <input type="submit" name="buttlogin" value="Îòïðàâèòü!" class="buttons" />
</form> </form>
</td> </td>

Loading…
Cancel
Save