jeudi 7 mars 2019

Get the path of the uploaded file

I want to get the path of the uploaded file (in spring). here is the code that I get the file from user and then get it from storageService class. Is this code correct at all? and what it should return? and am I right in using annotation? tnx :)

@GetMapping("/files/{filename:.+}")
@ResponseBody
public ResponseEntity<Resource> releaseMsisdn(@PathVariable String filename) throws IOException
{

    Resource file = storageService.loadAsResource(filename);
    setName(file.getFilename());
    file.getInputStream();

    Sending.msisdn();

}




Aucun commentaire:

Enregistrer un commentaire