Also, you should set the mimetype, based on what type of file the client has requested.