切换OSS为阿里云OSS,文件上传成功,文件访问还有问题

This commit is contained in:
starrySky
2024-03-23 23:22:26 +08:00
parent 92d239286e
commit 1fc4fec21f
2 changed files with 1 additions and 6 deletions

View File

@@ -11,8 +11,6 @@ import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
/**
@@ -42,8 +40,7 @@ public class CosController {
@ApiOperation(value = "获取cos临时密钥")
@GetMapping("/temp-key")
public R getTempKey() throws FileNotFoundException {
FileInputStream inputStream = new FileInputStream(new File("C:\\Users\\admin\\Pictures\\0001.jpg"));
ossFileService.upload(inputStream, "test", "0001.png");
return R.ok();
}
}