App_Data files

S

SushiSean

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
 
G

Guest

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 :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,286
Latest member
ChristieSo

Latest Threads

Top