I am trying to get the file size while uploading it using
properties.AfterProperties["vti_filesize"].ToString() but it always returns 0 while I am uploading ZIP files.
The "vti_filesize" can get file size for a document file. It is always null or zero when dealing with a folder.
A ZIP file is a zipped folder. Thus, you get the zero value.