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_
请问可否上传之后保存为原文件名?
參考 http://developer.qiniu.com/docs/v6/sdk/python-sdk.html#upload-do
第二個參數不能是None, 填原檔名就好。