limitSize = 8000 * 8000 '110000 kByte
if lenB(imgvalue) > limitSize then
response.write "<b>File ใหญ่เกิน " & FormatNumber(limitSize / 11000) & " KB คลิก Back กลับไปเลือกใหม่"
response.end
end if
' 6.3.upload to server
Set ScriptObject = Server.CreateObject("Scripting.FileSystemObject")
Set fileObj = ScriptObject.CreateTextFile(filepath & "/" & imgname)
For i = 1 to LenB(imgvalue)
fileObj.Write chr(AscB(MidB(imgvalue,i,1)))
Next
fileObj.Close
End Sub