Server.Request.SendFile C# (CSharp) Méthode

SendFile() public méthode

Sends a file back to the client
Assumes the application using this has checked whether it exists
public SendFile ( string filePath ) : void
filePath string
Résultat void
        public void SendFile(string filePath)
        {
            string type = "";
            if (DoesFileNameHaveExtentsion(filePath))
                type = MapMIMEType(filePath, type);

            using (Stream inputStream = FileStreamFactory.Create(filePath)) {
                // Send the header
                SendHeader(type, inputStream);

                SendResponseFromFile(inputStream);
            }
        }