Password Protected Excel Download using EPPLUS
Just need to use the .Save
overload with a password as the option:
package.Save("password");
Response To Comments
To apply a password if saving via a byte
array it is very similar:
Byte[] bin = pck.GetAsByteArray("password");
System.IO.File.WriteAllBytes(fullFilePath, bin);
It's not documented, but you can do as following:
package.Encryption.Password = "your password here";
Then serve your package with Save()
or GetAsByteArray()
of your choice