Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Final commit for file upload.
  • Loading branch information
Avinash Yachamaneni committed Oct 5, 2018
commit f86f82baafcdf106512827eaf7722dd5ad49854d
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
Expand All @@ -31,10 +32,7 @@ public class FileController {
public UploadFileResponse uploadFile(@RequestParam("file") MultipartFile file) {
String fileName = fileStorageService.storeFile(file);

String fileDownloadUri = ServletUriComponentsBuilder.fromCurrentContextPath()
.path("/downloadFile/")
.path(fileName)
.toUriString();
String fileDownloadUri = Paths.get("/Users", "TestApk").toString();

return new UploadFileResponse(fileName, fileDownloadUri,
file.getContentType(), file.getSize());
Expand Down