Skip to content

Commit

Permalink
Write file
Browse files Browse the repository at this point in the history
  • Loading branch information
Yinnii committed Oct 17, 2024
1 parent 0d59a72 commit a644b5a
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Base64;
Expand Down Expand Up @@ -333,12 +334,9 @@ private void performTrigger(BotConfiguration botConfig, String botname, ServiceF
ResponseEntity<JSONObject> response = null;

if (f != null && f.exists()) {
try (FileOutputStream fos = new FileOutputStream(f)) {
fos.write(decodedBytes);
}

FileSystemResource fileData = new FileSystemResource(f);
fileMp.add("file", fileData);
Files.write(f.toPath(), decodedBytes);
System.out.println("File:" + f);
fileMp.add("file", f);
headers.setContentType(MediaType.MULTIPART_FORM_DATA);
System.out.println("FileMp:" + fileMp);

Expand Down

0 comments on commit a644b5a

Please sign in to comment.