473,804 Members | 3,153 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

App_Data files

I have problems with sharing files from this directory. It is system
directory so I can't make dirrect links on files inside. For example
/App_Data/my.mp3
www.example.com/App_Data/my.mp3 - forbidden link

I have tring make a handker which should read this file and write to response
www.example.com/file.ashx?filename=my.mp3
But I have other problem with it. It can be different file and for any of
this I need to know
1) which Mime Content Type for this and
2) when it save it save with name of handler file file.ashx but it should be
my.mp3

So how I should make http links on files from App_Data.

ps. I use this App_Data folder for save my files only because it allow
create/remove directories without errors. If I remove some other folder
inside site - page as usual freezing
Dec 21 '07 #1
1 2823
The App_Data folder is "invisible" for users, because it is supposed to
contain database or xml files - secret files users must not see. If you want
to create direct links, create your own folder ("mp3" for example) asp.net
will not control this folder and it will be available for users. Another way
you mentioned - handler, you can find the MIME type here:
http://www.w3schools.com/media/media_mimeref.asp. Don't know how to solve
the other problem with file name, someone else will advise :)

"SushiSean" <Su*******@disc ussions.microso ft.comwrote in message
news:2E******** *************** ***********@mic rosoft.com...
I have problems with sharing files from this directory. It is system
directory so I can't make dirrect links on files inside. For example
/App_Data/my.mp3
www.example.com/App_Data/my.mp3 - forbidden link

I have tring make a handker which should read this file and write to
response
www.example.com/file.ashx?filename=my.mp3
But I have other problem with it. It can be different file and for any of
this I need to know
1) which Mime Content Type for this and
2) when it save it save with name of handler file file.ashx but it should
be
my.mp3

So how I should make http links on files from App_Data.

ps. I use this App_Data folder for save my files only because it allow
create/remove directories without errors. If I remove some other folder
inside site - page as usual freezing
Dec 22 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1933
by: Victor Paraschiv | last post by:
In a webservice I need to store the credentials in a xml file.Of course the password string is hashed. The XML is stored in App_Data. Now I need to open this file for read/write. I've tryed a lot of paths but none worked. Cassini tries to open a file from "'C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\App_Data\Users.xml' and IIS is not far from that. I've tryed the followind parths: "~/App_Data/Users.xml"
1
2671
by: kurt sune | last post by:
This drives me nuts,I have put a textfile in App_GlobalResources. How do I read it in runtime? I have googled for two days now. GetExecutingAssembly.GetManifestResourceStream("XYZ.xml") returns nothing. Should I put it in App_Data instead? How do I read it from there?
5
14362
by: CharlesA | last post by:
hi folks I'm working on reverse engineering TheBeerHouse by Marco Bellinaso which appears to have 100% unanimous approval on Amazon. I got the book and downloaded the code and I opened the solution. in his readme.txt he recommends that you move the database files he gives you in the App_data folder (called oddly aspnet.mdf and aspnet_log.mdf) and then attach them using sp_attach and rename them I renamed these TheBeerHouse (mdf and ldf)...
5
3434
by: wwwmike | last post by:
I have an asp.net 2.0 application where I move about 200,000 text files daily in and out. When using VS 2005 to debug my application everything works find if only a few files are in the folder. (The folder is locaed within the project file). Yesterday I did a stress test were I placed 200,000 files into this folder. As a result I took me about 15 mintues to start VS 2005 and I was not able to start debugging since the asp.net compiler...
2
1891
by: itfetish | last post by:
I've just upgraded our WIndows 2003 (with SBS server) web server to .Net framework 2.0 (it had 1.1 before) As I have been working on a web parts page on my laptop, hosting it there, working perfectly. I want to transfer it now, so I upgraded it. Created a new application pool for .net2.0 stuff, then used Visual Studio 2005 from my laptop to connect to Http://Bw-online/ProjectPoint and make a new website. Bw-online is our intranet at...
4
24370
by: Joey | last post by:
asp.net 2/C#/VS2005 I have a web app where I use a stream writer to create a CSV (text) file. I then use my code to save the file in the site's 'App_Data' folder, in a subfolder called 'Temp'. Finally, I redirect the page to that file in order to serve it out (push the download) to the user. This all worked great in .net v1.1. Now, in my new .net v2 app, everytime the page redirect occurs, the browser displays "The webpage cannot be...
6
29499
by: Andy Fish | last post by:
Hi, From what I can gather, under Asp.Net 2.0, it is safe to put data and config files underneath the app_data in the web root and they will not be served directly to the browser from a URL. Can anyone explain just how this feature works. is app_data a reserved name for IIS and ASP.Net, or is there some jiggery pokery going on behind the scenes with file permissions or virtual roots?
2
2513
by: Frank | last post by:
Hi, Originally I was planning to do some code reuse (yeah.. that exists..didn't want to believe it either) with some class library projects that I now want to use in a asp.net 2.0 web app in VS 2005. The solution contains both the web app and the class libraries. Inside the class libraries there are some xml files marked as content files and configured to be copied to the output directory on build. This worked perfectly fine for a...
6
9593
by: Mr. X. | last post by:
I have visual studio 2008. My site has a plesk on it. I want to deploy my project, and save it on the host machine. Looking for solution for folowings, please : 1st solution ======= Should ASPNETDB.MDF is necessary,
0
10588
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10324
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10085
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9161
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7623
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6857
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5527
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3827
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2998
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.