﻿<%

'    If Form("encode_base64").length > 0 Then
'      Title = "Result of Base64 encode"
'      If Form("source").Length = 0 Then 'no data
'          Message = "The source data are empty"
'      Else
'          'read the source data from "source" field
'          if not Form("source").isFile then FormData_source = Form("source")
'          
'          'get the source data as binary data
'          ByteArray.ByteArray = Form("source").ByteArray
'
'          'convert the source to Base64 and to unicode string
'          FormData_base64 = ByteArray.Base64.String
'      End If
'    else'decoder
'      '...
'    end if
	
		Set objFSO = Server.CreateObject("Scripting.FileSystemObject") 
		
		set f=objFSO.GetFile(Server.MapPath("images/background-user.png"))


string filePath = Server.MapPath("images/background-user.png")
File.WriteAllBytes(filePath, Convert.FromBase64String(base64imageString))
	
	
	'imgCtrl.Src = @"data:image/gif;base64," + Convert.ToBase64String(File.ReadAllBytes(Server.MapPath(@"/images/your_image.gif")));
%>




<br /><br />



