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

文件系统函数

SaveBase64AsFile

  根据Base64编码的内容解码并保存到指定的文件中。

 

说明

语法:

bool  SaveBase64AsFile('目标文件相对路径和文件名','使用Base64进行编码过的内容')

传回值:

布尔值,操作成功返回"True",操作失败返回"False"。


参数说明:

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

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

'使用Base64进行编码过的内容'

输入类型为字符,使用Base64进行编码过的内容。

 

内容说明

  根据Base64编码的内容解码并保存到指定的文件中。




 

表现层示例

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

<tr>

<td>SaveBase64AsFile('t.aspx','PCVAIFBhZ2UgbGFuZ3VhZ2U9ImMjIiBBdXRvRXZlbnRXaXJldXA9ImZhbHNlIiBJbmhlcml0cz0iTm9haFdlYi5FbmdpbmUiICU+DQo8IURPQ1RZUEUgSFRNTCBQVUJMSUMgIi0vL1czQy8vRFREIEhUTUwgNC4wMSBUcmFuc2l0aW9uYWwvL0VOIg0KImh0dHA6Ly93d3cudzMub3JnL1RSL2h0bWw0L2xvb3NlLmR0ZCI+DQo8aHRtbD4NCjxoZWFkPg0KPG1ldGEgaHR0cC1lcXVpdj0iQ29udGVudC1UeXBlIiBjb250ZW50PSJ0ZXh0L2h0bWw7IGNoYXJzZXQ9Z2IyMzEyIj4NCjx0aXRsZT7O3rHqzOLOxLW1PC90aXRsZT48bGluayBocmVmPSIvY3NzL21haW4xLmNzcyIgcmVsPSJzdHlsZXNoZWV0IiB0eXBlPSJ0ZXh0L2NzcyI+DQo8L2hlYWQ+DQoNCjxib2R5Pg0KPCEtLSAjQmVnaW5MaWJyYXJ5SXRlbSAiL0xpYnJhcnkvbG91dC5sYmkiIC0tPsLfvK2y48rks/bOu7XjPCEtLSAjRW5kTGlicmFyeUl0ZW0gLS0+DQo8L2JvZHk+DQo8L2h0bWw+DQo=')</td>

<td>&nbsp;<!-- NoahValue ValueName="SaveBase64AsFile('t.aspx','PCVAIFBhZ2UgbGFuZ3VhZ2U9ImMjIiBBdXRvRXZlbnRXaXJldXA9ImZhbHNlIiBJbmhlcml0cz0iTm9haFdlYi5FbmdpbmUiICU+DQo8IURPQ1RZUEUgSFRNTCBQVUJMSUMgIi0vL1czQy8vRFREIEhUTUwgNC4wMSBUcmFuc2l0aW9uYWwvL0VOIg0KImh0dHA6Ly93d3cudzMub3JnL1RSL2h0bWw0L2xvb3NlLmR0ZCI+DQo8aHRtbD4NCjxoZWFkPg0KPG1ldGEgaHR0cC1lcXVpdj0iQ29udGVudC1UeXBlIiBjb250ZW50PSJ0ZXh0L2h0bWw7IGNoYXJzZXQ9Z2IyMzEyIj4NCjx0aXRsZT7O3rHqzOLOxLW1PC90aXRsZT48bGluayBocmVmPSIvY3NzL21haW4xLmNzcyIgcmVsPSJzdHlsZXNoZWV0IiB0eXBlPSJ0ZXh0L2NzcyI+DQo8L2hlYWQ+DQoNCjxib2R5Pg0KPCEtLSAjQmVnaW5MaWJyYXJ5SXRlbSAiL0xpYnJhcnkvbG91dC5sYmkiIC0tPsLfvK2y48rks/bOu7XjPCEtLSAjRW5kTGlicmFyeUl0ZW0gLS0+DQo8L2JvZHk+DQo8L2h0bWw+DQo=')" MaxChar="" DChar="" Safety="False" --></td>

</tr>

<tr>

<td>SaveBase64AsFile('t.aspx',OpenFileAsBase64('logic.aspx'))</td>

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

</tr>

</table>


示例输出

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


 

逻辑层示例

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

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

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

<SetVar Name="message" Value="SaveBase64AsFile('r.txt','PCVAIFBhZ2UgbGFuZ3VhZ2U9ImMjIiBBdXRvRXZlbnRXaXJldXA9ImZhbHNlIiBJbmhlcml0cz0iTm9haFdlYi5FbmdpbmUiICU+DQo8IURPQ1RZUEUgSFRNTCBQVUJMSUMgIi0vL1czQy8vRFREIEhUTUwgNC4wMSBUcmFuc2l0aW9uYWwvL0VOIg0KImh0dHA6Ly93d3cudzMub3JnL1RSL2h0bWw0L2xvb3NlLmR0ZCI+DQo8aHRtbD4NCjxoZWFkPg0KPG1ldGEgaHR0cC1lcXVpdj0iQ29udGVudC1UeXBlIiBjb250ZW50PSJ0ZXh0L2h0bWw7IGNoYXJzZXQ9Z2IyMzEyIj4NCjx0aXRsZT7O3rHqzOLOxLW1PC90aXRsZT48bGluayBocmVmPSIvY3NzL21haW4xLmNzcyIgcmVsPSJzdHlsZXNoZWV0IiB0eXBlPSJ0ZXh0L2NzcyI+DQo8L2hlYWQ+DQoNCjxib2R5Pg0KPCEtLSAjQmVnaW5MaWJyYXJ5SXRlbSAiL0xpYnJhcnkvbG91dC5sYmkiIC0tPsLfvK2y48rks/bOu7XjPCEtLSAjRW5kTGlicmFyeUl0ZW0gLS0+DQo8L2JvZHk+DQo8L2h0bWw+DQo=')" />

<Echo ContentLinkId="viewmsg" />

</Out>

</Action>


示例输出

True

 

参考
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.