Added method for guessing and setting content type of upload files.