mirror of https://github.com/halo-dev/halo
refactor: attachment month path. (#636)
parent
437e59d8a2
commit
153f8ebbef
|
@ -97,8 +97,10 @@ public class LocalFileHandler implements FileHandler {
|
|||
int year = current.get(Calendar.YEAR);
|
||||
int month = current.get(Calendar.MONTH) + 1;
|
||||
|
||||
String monthString = month < 10 ? "0" + month : String.valueOf(month);
|
||||
|
||||
// Build directory
|
||||
String subDir = UPLOAD_SUB_DIR + year + FILE_SEPARATOR + month + FILE_SEPARATOR;
|
||||
String subDir = UPLOAD_SUB_DIR + year + FILE_SEPARATOR + monthString + FILE_SEPARATOR;
|
||||
|
||||
String originalBasename = FilenameUtils.getBasename(Objects.requireNonNull(file.getOriginalFilename()));
|
||||
|
||||
|
|
Loading…
Reference in New Issue