You've already forked FrameTour-BE
fix(image): 修复JPEG文件上传路径问题
- 从文件名中提取扩展名并标准化为小写 - 将.jpg扩展名统一转换为.jpeg - 更新上传路径以包含正确的图像类型目录 - 保持原有公共读取权限设置
This commit is contained in:
@@ -89,9 +89,13 @@ public class UploadStage extends AbstractPipelineStage<PhotoProcessContext> {
|
||||
|
||||
private String uploadFile(IStorageAdapter adapter, File file) throws Exception {
|
||||
String filename = file.getName();
|
||||
String extension = filename.substring(filename.lastIndexOf('.') + 1);
|
||||
if (extension.equals("jpg")) {
|
||||
extension = "jpeg";
|
||||
}
|
||||
String uploadPath = "print/" + filename;
|
||||
|
||||
String url = adapter.uploadFile(uploadPath, file);
|
||||
String url = adapter.uploadFile("image/" + extension, file, uploadPath);
|
||||
adapter.setAcl(StorageAcl.PUBLIC_READ, uploadPath);
|
||||
|
||||
return url;
|
||||
|
||||
Reference in New Issue
Block a user