This project is read-only.

New easy control.

Topics: Developer Forum
Feb 6, 2007 at 6:40 PM
Hi. Before sorry for my horrible english :-) I have new easy control. This control read files from folder and created html page with name of files, size and icon. It's good if a I have big files and put them into the folder with ftp. But i can't download this files, when i insert this folder in Appdata folder. If i put this folder into the root of aplication, it's all ok. How can i download files with this easy control from Appdata/ftpfiles? Thanks.
Feb 7, 2007 at 7:50 AM
I thought the AppData folder was protected from reading from outside the application. I don't think you have to put the files into that folder. But sorry, I don't have a solution for this.
I think you have to have your control get the file, not a link to get the file.
Feb 7, 2007 at 1:32 PM
Edited Feb 7, 2007 at 1:33 PM
Hi Salom

Due to security restrictions, the App_Data folder is not accessible directly from the web. This is usually the place, where you have your database and other important data files. Usually, you don't want your database to be downloadable by everyone ;-)

Two ways, how you could do this:

1st way to do this

Create your own "publicfiles" folder and put all the files in there. In your EasyControl, create the links to files in this folder.

2nd way to do this

In fact you still can put all your downloadable files into the AppData folder. To let webusers download the files however, you must create a HttpHandler that serves the files to the user. Have a look at "DownloadHandler.ashx" in the root of MWPSK. This is the handler, which is used in the DownloadSection. You can create something similar for your EasyControl. Just make sure, you have some sort of security checking, so that users cannot "accidentially" download all the content of your AppData folder.

Cheers
Matthias
Feb 7, 2007 at 6:28 PM
Thanks. I thought, that is about security restriction and i must use downloadhandler. But is so complicated. First way is ok for me... :-)