文件上传 - 关于七牛使用python上传文件之后文件名的问题
PHP中文网
PHP中文网 2017-04-17 13:02:29
0
1
859
import qiniu.conf

qiniu.conf.ACCESS_KEY = "ooooooooo"
qiniu.conf.SECRET_KEY = "xxxxxxxx"

import qiniu.rs
import qiniu.io
policy = qiniu.rs.PutPolicy("lylinuxbackup")
uptoken = policy.token()

localfile = 'wordpress.sql' 
policy = qiniu.rs.PutPolicy('xxxxxxxx') 
uptoken = policy.token()
data=open('wordpress1.sql')
ret, err = qiniu.io.put(uptoken, None, data)
print "ok!"

上面是代码 我上传到是本地的文件 文件名为wordpress1.sql
可是上传成功之后文件名变成类似于FtkZRfk8tTQAYJMb0MyIlrsBlod_
请问可否上传之后保存为原文件名?

PHP中文网
PHP中文网

认证0级讲师

reply all(1)
小葫芦

Reference http://developer.qiniu.com/docs/v6/sdk/python-sdk.html#upload-do
The second parameter cannot be None, just fill in the original file name.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template