File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -3591,9 +3591,11 @@ func (this *Server) initTus() {
35913591 log .Error (err )
35923592 continue
35933593 }
3594+ ext := path .Ext (name )
3595+ filename := md5sum + ext
35943596 timeStamp := time .Now ().Unix ()
3595- path := time .Now ().Format ("/20060102/15/04/" )
3596- newFullPath := STORE_DIR + "/" + Config ().DefaultScene + path + Config ().PeerId + "/" + md5sum + ".bin"
3597+ fpath := time .Now ().Format ("/20060102/15/04/" )
3598+ newFullPath := STORE_DIR + "/" + Config ().DefaultScene + fpath + Config ().PeerId + "/" + filename
35973599 if fi , err := this .GetFileInfoFromLevelDB (md5sum ); err != nil {
35983600 log .Error (err )
35993601 } else {
@@ -3607,12 +3609,12 @@ func (this *Server) initTus() {
36073609 }
36083610 }
36093611
3610- path = STORE_DIR_NAME + "/" + Config ().DefaultScene + path + Config ().PeerId
3611- os .MkdirAll (path , 0775 )
3612+ fpath = STORE_DIR_NAME + "/" + Config ().DefaultScene + fpath + Config ().PeerId
3613+ os .MkdirAll (fpath , 0775 )
36123614 fileInfo := & FileInfo {
36133615 Name : name ,
3614- Path : path ,
3615- ReName : md5sum + ".bin" ,
3616+ Path : fpath ,
3617+ ReName : filename ,
36163618 Size : info .Size ,
36173619 TimeStamp : timeStamp ,
36183620 Md5 : md5sum ,
You can’t perform that action at this time.
0 commit comments