Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
is ther any way to limit file upload size without acting at web.config level?
I mean is it there the possibility to evntually extend componet in order to block user upload when a certain size is reached or intecept upload and generate an error?
Thanks for kind answer
The HttpPostedFileBase class has a property named ContentLength which can be used to determine file size.
More on HttpPostedFileBase here: https://msdn.microsoft.com/en-us/library/system.web.httppostedfilebase(v=vs.110).aspx
public ActionResult Upload(HttpPostedFileBase file)
if (file.ContentLength < 1024)
// File is too large
Thanks Aaron for you flesh answer. You are right, but how can I apply this approach to Umbraco From FileUpload field?
Maybe my question is silly, but I don't know how to do it.
we've created a package which does exactly this: https://our.umbraco.com/projects/backoffice-extensions/umbraco-forms-on-perplex-steroids/.
Kind regards, Jeffrey
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted