NoahWeb
在线搜索
?
NoahWeb.net | 开发者交流中心 | 支持 | 文档 | 反馈缺陷 

文件系统函数

OpenFileAsBase64

  打开指定的文件并返回该文件经过Base64编码后的内容。

 

说明

语法:

String  OpenFileAsBase64('目标文件路径和文件名')

传回值:

字符,经过Base64编码以后的文件内容


参数说明:

'目标文件路径和文件名'

输入类型为字符,需要读取的目标文件路径和文件名字符串。文件所在的目录必须是当前站点目录下的一个子目录,路径描述使用相对路径。如:'/path/p1/test.aspx'

 

内容说明

  打开指定的文件并返回该文件经过Base64编码后的内容。



 

表现层示例

<table width="100%" border="1" cellspacing="0" cellpadding="2">

<tr>

<td>OpenFileAsBase64('logic.aspx')</td>

<td>&nbsp;<!-- NoahValue ValueName="OpenFileAsBase64('logic.aspx')" MaxChar="" DChar="" Safety="False" --></td>

</tr>

</table>


示例输出

OpenFileAsBase64('logic.aspx')  PCVAIFBhZ2UgbGFuZ3VhZ2U9ImMjIiBBdXRvRXZlbnRXaXJldXA9ImZhbHNlIiBJbmhlcml0cz0iTm9haFdlYi5FbmdpbmUiICU+DQo8IURPQ1RZUEUgSFRNTCBQVUJMSUMgIi0vL1czQy8vRFREIEhUTUwgNC4wMSBUcmFuc2l0aW9uYWwvL0VOIg0KImh0dHA6Ly93d3cudzMub3JnL1RSL2h0bWw0L2xvb3NlLmR0ZCI+DQo8aHRtbD4NCjxoZWFkPg0KPG1ldGEgaHR0cC1lcXVpdj0iQ29udGVudC1UeXBlIiBjb250ZW50PSJ0ZXh0L2h0bWw7IGNoYXJzZXQ9Z2IyMzEyIj4NCjx0aXRsZT7O3rHqzOLOxLW1PC90aXRsZT48bGluayBocmVmPSIvY3NzL21haW4xLmNzcyIgcmVsPSJzdHlsZXNoZWV0IiB0eXBlPSJ0ZXh0L2NzcyI+DQo8L2hlYWQ+DQoNCjxib2R5Pg0KPCEtLSAjQmVnaW5MaWJyYXJ5SXRlbSAiL0xpYnJhcnkvbG91dC5sYmkiIC0tPsLfvK2y48rks/bOu7XjPCEtLSAjRW5kTGlicmFyeUl0ZW0gLS0+DQo8L2JvZHk+DQo8L2h0bWw+DQo=


 

逻辑层示例

  此示范需要存在文件"logic.aspx"和当前空间下具有"viewmsg"字符资源。

<Action name="logic.demo" NextAction="">

<Out Area="/Library/lout.lbi">

<SetVar Name="message" Value="OpenFileAsBase64('logic.aspx')" />

<Echo ContentLinkId="viewmsg" />

</Out>

</Action>


示例输出

PCVAIFBhZ2UgbGFuZ3VhZ2U9ImMjIiBBdXRvRXZlbnRXaXJldXA9ImZhbHNlIiBJbmhlcml0cz0iTm9haFdlYi5FbmdpbmUiICU+DQo8IURPQ1RZUEUgSFRNTCBQVUJMSUMgIi0vL1czQy8vRFREIEhUTUwgNC4wMSBUcmFuc2l0aW9uYWwvL0VOIg0KImh0dHA6Ly93d3cudzMub3JnL1RSL2h0bWw0L2xvb3NlLmR0ZCI+DQo8aHRtbD4NCjxoZWFkPg0KPG1ldGEgaHR0cC1lcXVpdj0iQ29udGVudC1UeXBlIiBjb250ZW50PSJ0ZXh0L2h0bWw7IGNoYXJzZXQ9Z2IyMzEyIj4NCjx0aXRsZT7O3rHqzOLOxLW1PC90aXRsZT48bGluayBocmVmPSIvY3NzL21haW4xLmNzcyIgcmVsPSJzdHlsZXNoZWV0IiB0eXBlPSJ0ZXh0L2NzcyI+DQo8L2hlYWQ+DQoNCjxib2R5Pg0KPCEtLSAjQmVnaW5MaWJyYXJ5SXRlbSAiL0xpYnJhcnkvbG91dC5sYmkiIC0tPsLfvK2y48rks/bOu7XjPCEtLSAjRW5kTGlicmFyeUl0ZW0gLS0+DQo8L2JvZHk+DQo8L2h0bWw+DQo=

 

参考
Is_File,Is_Dir,FileMoveTo,FileCopyTo,FileDel,DirMoveTo,DirCreate,DirDel,DirList,FileList,FileSize,FileCreateDateTime,FileLastAccessDateTime,FileLastWriteDateTime,SaveBase64AsFile,OpenFileAsBase64,ReadFile,SaveFile

查看NoahWeb在线手册

Copyright © 2001-2004 The NoahWeb Corporation
All rights reserved.