app-data

Security of APP_Data Folder in ASP.NET

自闭症网瘾萝莉.ら 提交于 2019-12-01 20:35:32
My Microsoft Access DB file is in APP_DATA folder. my server is Windows 2003 and I like to know how is the best way to protect this file. so which one is safer ? ./wwwroot/App_data/Database.mdb or ./db/Database.mdb Both methods are safe in the sense that the file won't get served to a remote client (unless you create a virtual path to the db folder. Files not served from a site are governed by the httpHandlers section in web.config: <add path="*.mdb" verb="*" type="System.Web.HttpForbiddenHandler" validate="True" /> Any file type added here with type=HttpForbiddenHandler will not be served.

Show image stored in App_Data

◇◆丶佛笑我妖孽 提交于 2019-12-01 19:38:58
问题 I have 2 image files in my App_Data directory and I want to show them in my view like this: @foreach (var media in Model) { <div class="col-lg-3 col-md-4 col-xs-6 thumb"> <a class="thumbnail"><img src="@Url.Content("~/App_Data/uploads/" + @media.URL)" alt="image" /></a> </div> } When I check the link in the browser I get this : <img src="/App_Data/uploads/Warnings.png" alt="image"> It says he can't find the image. How can I set the correct link? 回答1: The App_Data folder is a special .NET

Can't check in .mdf/.ldf in App_Data into TFS

一笑奈何 提交于 2019-12-01 08:08:02
I am working with ASP.NET C# MVC 5. .mdf/.ldf files in App_Data do not appear on Pending Changes in team explorer. Therefore I can't check them into TFS(visual studio online). I've tried recreating the project a few times and none worked. What might be the cause for this? Go to Team Explorer and locate Excluded Changes and you should find it excluded. Right click the App_Data folder and include it. But you might want to reconsider including the database files. As you're developing and testing, every little database interaction will trigger a change and most of those are trivial. Also, if

Can't check in .mdf/.ldf in App_Data into TFS

亡梦爱人 提交于 2019-12-01 05:43:49
问题 I am working with ASP.NET C# MVC 5. .mdf/.ldf files in App_Data do not appear on Pending Changes in team explorer. Therefore I can't check them into TFS(visual studio online). I've tried recreating the project a few times and none worked. What might be the cause for this? 回答1: Go to Team Explorer and locate Excluded Changes and you should find it excluded. Right click the App_Data folder and include it. But you might want to reconsider including the database files. As you're developing and

ASP.Net - App_Data & App_Code folders?

人盡茶涼 提交于 2019-11-27 23:27:18
What is the point of having App_code & App_data folders? Why doesn't my objectDataSource detect classes unless files are in App_Code? Please provide as much detail as you can, I'm new to ASP.Net These folders have special purpose. From this article - ASP.NET Web project folder structure. App_Code App_Code contains source code for shared classes and business objects (for example, ..cs, and .vb files) that you want to compile as part of your application. In a dynamically compiled Web site project, ASP.NET compiles the code in the App_Code folder on the initial request to your application. Items

Images that are in App_Data folder not shown in browser

六月ゝ 毕业季﹏ 提交于 2019-11-27 13:56:34
When I set image URL property to asp image control that is in App_Data folder, image is showing in page design view but not in browser. <form id="form1" runat="server"> <div> <asp:Image ID="Image1" runat="server" ImageUrl="~/App_Data/p3.jpg" /> </div> </form> It seems to be straightforward, but it's not showing the image. marc_s The App_Data folder is a special folder reserved for data such as database files and so on, and will NOT render out any contents on the web. This is by design, and intentional and cannot be changed (as far as I know). Your images do definitely not belong into the App

What is the App_Data folder used for in Visual Studio?

百般思念 提交于 2019-11-26 01:58:30
问题 When creating a new ASP.NET application in Visual Studio, a couple of files and folders are created automatically. One of those folders is called App_Data . Also when publishing a website by selecting the menu option Build->Publish a checkbox is available Include files from the App_Data folder . Am I right assuming that the files put in this file and its sub-folders are not going to be accessible through the web? For example, would it be safe to put in that folder resources that I only intend