问题
Just starting to test the FineUploader and I wonder:
When FineUploader uploading files directly to a blob container on azure, I see the files (guid name instead of the original).
Is there any option to set on the server side the file name and the full path to save the file ?
回答1:
Yes, you can retrieve the name for any file before it is uploaded from your server via an ajax call and supply it to Fine Uploader Azure by making use of the fact that the blobProperties.name option allows for a promissory return value. For example:
new qq.azure.FineUploader({
blobProperties: {
name: function(fileId) {
return new Promise(function(resolve) {
// retrieve file name for this file from your server...
resolve(filenameFromServer)
})
}
},
// all other options here...
})
The above option will be called by Fine Uploader Azure once per file, just before the first request is sent. This is true of chunked and non-chunked uploads. The value passed into resolve
will be used as the new file name for the associated file.
来源:https://stackoverflow.com/questions/36446982/fineuploader-server-side-renaming-the-file-before-the-put-method