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
Hi,
Is there any way to restrict uploading files inside media folder.
I can see an option inside UmbracoSettings.Config
<disallowedUploadFiles>ashx,aspx,ascx,config,cshtml,vbhtml,asmx,air,axd,swf,xml,html,htm,svg,php,htaccess</disallowedUploadFiles>
Actually I need to upload only .jpg,.png,.jpeg,.gif files only.
So,it will be difficult to specify all the file types inside "disallowedUploadFiles".
Please help me ASAP.
Thanks in advance
Anju
You should set the maxRequestLength in your web.config
<configuration> <system.web> <httpRuntime maxRequestLength="xxx" /> </system.web> </configuration>
https://msdn.microsoft.com/en-us/library/e1f13641(v=vs.85).aspx
For IIS7 and higher I believe you should include the following in your web.config
<system.webServer> <security> <requestFiltering> <requestLimits maxAllowedContentLength="52428800" /> </requestFiltering> </security> </system.webServer>
Hi Anju,
What you could do is use saving event of the mediaservice (see https://our.umbraco.org/documentation/reference/events/mediaservice-events )
Then you can cancel the save when the file doesn't have the correct extension.
Best,
Richard
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Restricting files in media folder
Hi,
Is there any way to restrict uploading files inside media folder.
I can see an option inside UmbracoSettings.Config
Actually I need to upload only .jpg,.png,.jpeg,.gif files only.
So,it will be difficult to specify all the file types inside "disallowedUploadFiles".
Please help me ASAP.
Thanks in advance
Anju
You should set the maxRequestLength in your web.config
https://msdn.microsoft.com/en-us/library/e1f13641(v=vs.85).aspx
For IIS7 and higher I believe you should include the following in your web.config
Hi Anju,
What you could do is use saving event of the mediaservice (see https://our.umbraco.org/documentation/reference/events/mediaservice-events )
Then you can cancel the save when the file doesn't have the correct extension.
Best,
Richard
is working on a reply...