ASP.NET Handler for managing images/files

cedricbaboon

New Member
I need to do the following:[*]Show Image on a page[*]Show a link to a document (PDF, DOC etc) that opens up the document[*]Upload a imageI have the functionality in the backend that has the following signatures:\[code\]public byte[] GetFile(string fileName) //For both documents and imagespublic void AddFile(string fileName, byte[] data) //For both documents and images\[/code\]My question is, can I write a handler that can get images/documents and upload images/documents so that I can use it in my client by doing a:\[code\]<asp:Image runat="server" ImageUrl="~/Image.ashx?FileName=myFileName" />\[/code\]The handler in turn would call the \[code\]GetFile\[/code\] and \[code\]AddFile\[/code\] methods.This may work for showing images. What about showing documents and uploading images/documents?Also, what about the security associated with the handler? Can a malicious user use it?
 
Back
Top