Here Mudassar Ahmed Khan has explained with an example, how to convert HttpPostedFile class object to Base64 string using C# and VB.Net.
The HttpPostedFile class object holds the File data for the ASP.Net FileUpload control.
In order to convert HttpPostedFile class object to Base64 string, first the HttpPostedFile class object is converted to Byte Array using the ReadBytes method of the BinaryReader class is used.
Then the Byte Array is converted to Base64 string using the ToBase64String method.
↧