0

I'm currently trying to grasp the concept in this File upload tutorial in Spring Boot especially the StorageProperties.

I'm wondering: where will the uploaded files go? I searched the resources folder and static but no file are being uploaded there.

Willi Mentzel
  • 27,862
  • 20
  • 113
  • 121
  • It depends on you where you want to store your file. In given link you have to implement StorageService interface and write your logic to store file in void store(MultipartFile file); method. – Yogesh Prajapati Sep 20 '19 at 10:25
  • I know about the StorageService and its implementation.. I want to know about the value inside the StorageProperties Configuration, i don't know what directory the files are being uploaded and im wondering how would i set it up so that it will be save in the static folder. – Michael Pingol Sep 20 '19 at 11:34
  • so i did try to understand the code in the implementation of the StorageService and i found that the Path.resolve point to upload-dir\filename and the folder is put at the Project root folder outside the source. I know this already solve my question but how do i set the storage property to save uploaded files to the application resource folder. – Michael Pingol Sep 20 '19 at 12:21
  • Please provide code sample what you have tried. – Yogesh Prajapati Sep 20 '19 at 13:34

2 Answers2

1

The StorageService is just an interface. You have to provide its implementation.

Checkout this Github Repo, Sample App

Rahil Husain
  • 570
  • 3
  • 14
1

I found an answer to my question and the answer is you cannot upload a file that will be effectively inside a Jar.

https://stackoverflow.com/a/36769132/4748775

Im sorry for such question. hopefully this may help other beginners looking for a way to upload inside the project structure.