函数名

writeFileBase64(path,base64)

函数介绍

方法名称:文件base64编码写入到文件

参数说明:
path:要写入的文件绝对路径

base64:base64文件的编码


返回值:

ret:true代表成功,flase代表失败

res:返回失败的结果

函数例子

--获取一键玩网络文件base64

local base64 = httpPost("http://pc.yijianwan.com:8080/yjw_pc_login/api/webFile64/getFile?作者=100003&用户标识=zuozhe&文件名=123.txt")

if string.find(base64, "错误") then

    print("获取失败:"..base64)

else

   --将网络文件写入本地

    local ret,res = writeFileBase64("/sdcard/111.txt", base64)

    if ret then

        --写入成功

        print("写入成功")

    else

        --写入失败

        print("错误原因:"..res)

    end

end