add(req-2080):创建文件夹---修改路径
This commit is contained in:
parent
a10a32c45e
commit
d8ee4faf51
@ -31,6 +31,7 @@ import org.springframework.core.env.Environment;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@ -668,11 +669,12 @@ public class FileServiceImpl implements FileService {
|
|||||||
absolutePath = tempDirectory + SEPARATOR + fileName;
|
absolutePath = tempDirectory + SEPARATOR + fileName;
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
String absolutePath = rootDir + SEPARATOR + fileName;
|
String absolutePath = rootDir + fileName;
|
||||||
log.info("临时文件夹,{}", absolutePath);
|
log.info("临时文件夹,{}", absolutePath);
|
||||||
|
|
||||||
// 创建输出流并写入数据
|
// 创建输出流并写入数据
|
||||||
OutputStream output = Files.newOutputStream(Paths.get(absolutePath));
|
// OutputStream output = Files.newOutputStream(Paths.get(absolutePath));
|
||||||
|
OutputStream output = new FileOutputStream(absolutePath);
|
||||||
byte[] buffer = new byte[1024];
|
byte[] buffer = new byte[1024];
|
||||||
int length;
|
int length;
|
||||||
while ((length = input.read(buffer)) > 0) {
|
while ((length = input.read(buffer)) > 0) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user