服务器上传文件权限怎么解决,使用 base64 命令绕开服务器无权限上传文件问题...

Windows 平台

生成 base64 字符串

生成的base64字符串保存到back.txt文件。

certutil -encode test.png back.txt

base64 恢复成文件

certutil -decode back.txt test-recover.png

校验文件 md5 是否一致

原始文件md5值:

certutil -hashfile test.png md5

输出

C:\Users\fendoudebb\Desktop>certutil -hashfile test.png md5

MD5 的 test.png 哈希:

edad7c9c3752e2ac95f3db6881705984

CertUtil: -hashfile 命令成功完成。

恢复文件md5值:

certutil -hashfile test-recover.png md5

输出

C:\Users\fendoudebb\Desktop>certutil -hashfile test-recover.png md5

MD5 的 test-recover.png 哈希:

edad7c9c3752e2ac95f3db6881705984

CertUtil: -hashfile 命令成功完成。

注意

certutil不能使用>管道命令符。

Windows平台certutil命令生成的base64字符串头部及尾部携带了两行字符串。如果需要把文字拷贝到Linux服务器,则必须去除这两行。

-----BEGIN CERTIFICATE-----

...

-----END CERTIFICATE-----

Linux 平台

生成 base64 字符串

base64 test.png > back.txt

base64 恢复成文件

base64 -d back.txt > test-recover.png

校验文件 md5 是否一致

原始文件md5值:

md5sum test.png

输出:

edad7c9c3752e2ac95f3db6881705984 test.png

恢复文件md5值:

md5sum test-recover.png

输出:

edad7c9c3752e2ac95f3db6881705984 test-recover.png

注意

Linux必须使用>管道命令符。