'GZip object that compress the file
Dim myStreamZip As New GZipStream(myCompressedFile, CompressionMode.Compress)
'Write Back
myStreamZip.Write(myBuffer, 0, myBuffer.Length)
myStreamZip.Close()
Me.lblResult.Text = """" + strName lblResult.Text = lblResult.Text + " was compressed &uploaded successfully."
What we do here is read the file into a stream, change its extension to the appropriate GZ ext, and compress using the GZipStream compression method.
https://www.besanttechnologies.com/training-courses/dot-net-training