Last post Aug 19, 2011 01:13 PM by LudovicoVan
Aug 19, 2011 06:42 AM|mynickname|LINK
I would like to allow users in my app to add attachments to messages and web pages etc. My idea is to store it at file system but I dont want to use real absolute paths to files. I would like to use some generated links to files just for one request or something
like this. But I dont know how to do it or where to find out some tutorial. Could you please give me some tips where to start?
Thank you for your replies.
Aug 19, 2011 07:23 AM|mike2315|LINK
use sql server to store files you will find 100 examples how to store and retrive files in sql server
Aug 19, 2011 01:13 PM|LudovicoVan|LINK
Don't store files in Sql Server unless you have a specific requirement to do so.
It is sufficient to store the filename in the database and the folder path in the web.config: at runtime the full path of any file can be obtained by combining the two, and if the folder path changes, a change to the web.config will be enough.
Also, in order to avoid users seeing each others' files, files should better be stored in a folder outside of the web root and served via an httphandler. There are many tutorials and examples on the Web about serving files with an httphandler.