Solution One (thinkphp officially provided, I have not tested): upgrade to ThinkPHP3.1 the latest UploadFile.class.php (https://github.com/liu21st/ extend/tree/master/extend/library/org/net), replace the original UploadFile.class.php after downloading
workaround Two: Modify part of the code for UploadFile.class.php
This is your own solution, add a thumbnail of the sub-directory generation function
Step 1>>
Create a Getthumbsubname () function in UploadFile.class.php by imitating the getsubname () function
Copy the Code code as follows:
Private Function Getthumbsubname ($file) {
Switch ($this->subtype) {
Case ' Date ':
$dir = Date ($this->dateformat,time ());
Break
Case ' Hash ':
Default
$name = MD5 ($this->thumbpath);
$dir = ";
for ($i =0; $i < $this->hashlevel; $i +) {
$dir. = $name {$i}. ' /';
}
Break
}
if (!is_dir ($this->thumbpath). $dir)) {
mkdir (($this->thumbpath). $dir);
}
return $dir;
}
Step 2>>
UploadFile.class.php in line 158 instead
Copy the Code code as follows:
$thumbPath = $this->thumbpath? $this->thumbpath. ($this->autosub? $this->getthumbsubname ($file). ' /': '): $file [' Savepath '];
Finally solve the problem!