Skip to content

Commit 3eeff01

Browse files
committed
Fixed issue #54.
1 parent bc09c82 commit 3eeff01

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/file.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,12 +505,14 @@
505505
if(AV._isNode){
506506
//Use qiniu sdk to upload files to qiniu.
507507
var qiniu = require('qiniu');
508+
var path = require('path');
508509
self._previousSave = self._source.then(function(base64, type) {
509510
//Create 16-bits uuid as qiniu key.
510511
var hexOctet = function() {
511512
return Math.floor((1+Math.random())*0x10000).toString(16).substring(1);
512513
};
513-
var key = hexOctet() + hexOctet() + hexOctet() + hexOctet();
514+
var key = hexOctet() + hexOctet() + hexOctet() + hexOctet()
515+
+ path.extname(self._name);
514516
var data = {
515517
key: key,
516518
ACL: self._acl,

0 commit comments

Comments
 (0)