Is there a way to find out the size of the attachment that is sent in an email in asp.net C #?
thank!
If you use System.Net.Mailand attach a file using a class Attachment, then each attachment must have a ContentStreamproperty containing the actual file. This type property Streamhas a property Length(type long) that gives the file size in bytes.
System.Net.Mail
Attachment
ContentStream
Stream
Length
long
Usually base64 attachments are encoded in System.Net.Mail. base64 takes 3 bytes and converts them to 4 bytes.
, ( Stream.Length, , ), .75.
, base64, SMTP.
I believe you can use the HttpFileCollection class. It gives you access to all files uploaded by the client. Here is the msdn link