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_
请问可否上传之后保存为原文件名?
高洛峰2017-04-17 13:04:29
参考 http://developer.qiniu.com/docs/v6/sdk/python-sdk.html#upload-do
第二个参数不能是None, 填原文件名就好。