Call Path.GetFileName on the result to get only the file name e.g.
attachments.SaveAs(Path.GetFileName(fileName));
If the value of fileName
is a file path it will return the file name (with ext), if it is already a valid file name it will just return the same value.