我正在使用sftp python库上传和重命名文件。上传过程成功,但当我尝试执行重命名方法时,我得到import pysftp
...
connection = pysftp.Connection(**config)
connection.put(fileName,preserve_mtime=True) #fileName contains file local path
...
oldName = fileName.split('/')[-1]
new_name = oldName.replace('_tmp','')
connection.rename(oldName,newName)
。有谁知道为什么会这样?
更新
使用的代码是:
jQuery Form Validator is a feature rich and multilingual jQuery plugin that makes it easy to validate user input while keeping your HTML markup clean from javascript code. Even though this plugin has a wide range of validation functions it's designed to require as little jQuery network traffic as possible. This is achieved by grouping together validation functions in "modules", making it possible to load only those functions that's needed to validate a particular form
<form action="/registration" method="POST">
<p>
User name (4 characters minimum, only alphanumeric characters):
<input data-validation="length alphanumeric" data-validation-length="min4">
</p>
<p>
Year (yyyy-mm-dd):
<input data-validation="date" data-validation-format="yyyy-mm-dd">
</p>
<p>
Website:
<input data-validation="url">
</p>
<p>
<input type="submit">
</p>
</form>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-form-validator/2.3.26/jquery.form-validator.min.js"></script>
<script>
$.validate({
lang: 'es'
});
</script>