我的代碼是這樣的,當用戶像1上傳時,如何在文件名的前面添加像「123_」這樣的前綴。 JPG,然後將其更改爲123_1.jpg到服務器?如何在使用qq.FileUploader上傳文件時在文件名中添加前綴字符串
<script type="text/javascript">
var uploader = new qq.FileUploader({
element: document.getElementById('file-uploader'),
allowedExtensions: ["jpg", "pdf"],
template: '<div class="qq-uploader">' +
'<div class="qq-upload-drop-area"><span>drag the files to here to upload</span></div>' +
'<div class="qq-upload-button">upload files</div>' +
'<ul class="qq-upload-list"></ul>' +
'</div>',
action: '@Url.Action("upload", new { staffId = Model.StaffId })'
});
</script>
什麼是在客戶端而不是服務器端添加前綴的文件名的地步? –
爲什麼你需要客戶端的前綴?一般的做法是在上傳後在服務器上添加前綴或後綴。 – ahmet
對不起,我的意思是在服務器端添加前綴 – kaihong