mirror of
https://github.com/RoastSlav/quickdrop.git
synced 2026-01-04 13:40:13 -06:00
fix
This commit is contained in:
@@ -32,6 +32,14 @@ public class FileUtils {
|
||||
return request.getScheme() + "://" + request.getServerName() + "/file/share/" + fileEntity.uuid + "/" + token;
|
||||
}
|
||||
|
||||
public static long bytesToMegabytes(long bytes) {
|
||||
return bytes / 1024 / 1024;
|
||||
}
|
||||
|
||||
public static long megabytesToBytes(long megabytes) {
|
||||
return megabytes * 1024 * 1024;
|
||||
}
|
||||
|
||||
public static void populateModelAttributes(FileEntity fileEntity, Model model, HttpServletRequest request) {
|
||||
model.addAttribute("file", fileEntity);
|
||||
model.addAttribute("fileSize", formatFileSize(fileEntity.size));
|
||||
|
||||
Reference in New Issue
Block a user