Sitecore file drop area destination folder - asp.net

I need to know if Sitecore Field File Drop Area can have different location set to save uploaded files?
I need to set different folder (media library) because content authors do not have access/rights to publish uploaded files in File Drop Area, saved under /System/.
The best part is that on Production Instance I do not have admin rights to modify security and access for content authors.
Question is: there is an option to set another destination folder on FileDropArea from CMS or only new written custom field can do it.

It looks like you can change the root folder, but you need to do it in the WebDAV config settings. The setting to change the root FileDropArea location is:
WebDAV.FileDropAreaMediaLocation
Its not in the sitecore config by default so add it via an include file:
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<settings>
<setting name="WebDAV.FileDropAreaMediaLocation" value="/sitecore/media library/my uploads" />
</settings>
</sitecore>
</configuration>
But I don't think you will need too. The files are not uploaded to the System area of the content tree, but the system folder in the Media Library.
As long as your editors are members of the sitecore/Authors role, they should have access to see this folder and its contents.

Related

Sitecore IconCache images not displaying, paths are incorrect

I'm trying to set up a Sitecore 8.1 instance that I've taken over from another agency. I have the site running but none of the image files from the IconCache are displaying in Sitecore:
I inspected the missing images and found that their paths are incorrect- they all begin with "/~/icon/" rather than "/temp/IconCache"
In the production instance, the icon paths are correctly set to /temp/IconCache.
There is a know issue about this missing icons.
See Sitecore.Support.100371.100542
https://github.com/sitecoresupport/Sitecore.Support.100371.100542/releases
Another thing you can try is run the Clean up databases from the Control Panel, core database, but likely you need the patch.
For further research:
The icons are stored on file system in .zip files below:
\sitecore\shell\Themes\Standard\
For example this url
/~/icon/Office/24x24/publishing_restrictions.png.aspx
go to the
\sitecore\shell\Themes\Standard\Office.zip
Check if the icons are on file system. And check if the url works, if the icon url not work find out why. which error? use the original Sitecore config files and web.config file. and check if it works.
You need to have this in config
<customHandlers>
<handler trigger="~/icon/" handler="sitecore_icon.ashx" />
And in the web.config
<handlers>
<add verb="*" path="sitecore_icon.ashx" type="Sitecore.Resources.IconRequestHandler, Sitecore.Kernel" name="Sitecore.IconRequestHandler" />
After the icon is used it is stored in the
\temp\IconCache
directory.

Restrict browsing an XML file using web.config

I have an application where I have an XML file which holds the connection string.
When hit the URL with the exact file name it opens the file in the browser that is natural.
Now I need to restrict this file browsing and I can not change that code to do any redirect or anything else.
What I have tried is using denyurlsequences in the security tag in the web.config but it restricts the application too to access the file and that makes the application stop working.
I am using .NET Framework 2.0
The ".xml" file extension is not supported by ASP.NET pipeline that is why you cannot add it to web.config and restrict it. What you can do is to copy the xml file in the "App_Data" folder of your application.
The purpose of this folder is to hide it files from browsers/users and also is build for this type of data.
To create "App_Data" folder if it already does not exist :
Right click on your project -> Add ASP.NET Folder -> App_Data
Or just add a folder and call it App_Data
I know its old question but this answer may be helpful for others.
I did below configurations on IIS 8.5 ( make sure Request Filtering is installed on IIS.)
Open IIS and click on your application virtual directory.
In features View, Click on Request Filtering and then go to Hidden Segments tab - this tab will contain list of hidden files or folders. (like web.config, APP_data folder etc...)
Add file or folder you want to hide from the browsing by click on add hidden segment and mention file/folder name you want to hide and test it.
In our application we have a master xml file stored in an application folder, to deny browsing this xml file I had added the folder name in hidden segments and it worked.

Facing issues while trying to set Upload Limits settings in Page level

I have upload functionality in my application. I was facing an upload issue and found out that in Web.Config there is httpRuntime tag. I set the change as below.
<httpRuntime requestValidationMode="2.0" maxRequestLength="2147483647" />
This fixed my upload issue. The above is my Web.Config in my root folder, one that we get by default.
Questions.
Can I create a seperate Web.config file? If Yes, I have to upload the files in some other Virtual Directory and my code is in some other project. So where shall i place the Web.Config file ?
Is it possible to set these settings at page level?
You can add a web.config file to nearly any folder (I doubt the app_data would allow it (but I could be wrong, however this is beside the point)).
You can of course (if possible) create many folders for each setting you need. In other words, have 1 file per folder to get around your issue.
Or, create a new parent folder which you want all sub folders to 'inherit' your new web.config file from. Your web.config file goes into this new parent folder.
Remember, the web.config file inherits from the parent web.config file, so you don't need to write the entire configuration again, just the section you want to add/overwrite.

Setting folder default page in aspnet

My question is really simple. I have a Web application with multiple sub-folders and there's no Default.aspx page in any of these.
How do I set the default page in each of these folders so users can type /folder instead of /folder/login.aspx?
Can this be done through the web.config file?
Should I just rename the file in each folder to Default.aspx?
Thanks!
There is a default document section for web.config, and you can even put a web.config in each folder, and inside that config just have the default document set.
There's a Default Document icon in the IIS section of your websites configuration panel. Open that up and you can add login.aspx to the list.

asp.net location tag not working

We have an application that is making use of the location tag in the web.config file at the machine level - meaning like C:\Windows\Microsoft.NET\Framework\v2.0...\CONFIG\web.config, the one that applies to the whole server - this application has lots of virtual directories under it and for each one there is a
<location path="IIS Web App Name\CustomerA">...
This seems to work ok for that app. But then we have a second app on the same server, and I'd like to add location tags to that app's web.config file - meaning the local web.config file in the app's directory - and have each one of them specify a location tag in a similar way.
Is this possible? Because it doesn't seem to work. I've tried:
<location path="My IIS App Name\CustomerA"> ...
and
<location path="CustomerA"> ...
and neither seem to work. I just need this location node to contain 1 node.
Is there maybe some
It would have to be a file or folder within that virtual. So I could set rules for "default.aspx" in the same root as the config file, or manage a folder like "Content" for the Content folder. I've done this successfully.
Or, put another config file in the folder you want to set custom rules for, and define rules there that will override the main...
HTH.

Resources