ASP Classic - convert base64binary string to byte array

橙三吉。 提交于 2020-01-11 09:47:07

问题


I am trying to convert a base64binary string to a byte array in classic ASP. StrConv() doesn't exist in ASP.

My objective is to take the base64binary string received from a web service call, and write the binary format to a file.

thanks,
-m


回答1:


When faced with a similar situation some time ago, I used MSXML to convert the data to a byte array before saving it to a file. You will need version 3 or higher.

To do this you would:

  • Load the data with MSXML
  • Set the node's dataType property to bin.base64
  • Read the binary data from the node using the nodeTypedValue property
  • To save the file you can use the ADODB.Stream component.

A few links on how the to this are below.

http://ghads.wordpress.com/2008/10/17/vbscript-readwrite-binary-encodedecode-base64/

http://support.microsoft.com/kb/254388

http://www.motobit.com/tips/detpg_binasp/



来源:https://stackoverflow.com/questions/3633160/asp-classic-convert-base64binary-string-to-byte-array

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!