Incorporate Path.GetExtension(file.FileName) into the following code filename = Guid.NewGuid() + file.FileName+ Path.Getextension(file.filename);
Making the file operation asynchronous can enhance performance