Комментарии:
Same thing can you done without rest controller use JSP page please reply how can we do this with Excel sheet download and data show in JSP from db
ОтветитьHii bro could you please tell me that the file upload can be using seperate package or can be used with the application please reply
ОтветитьHi Shabir you are awesome I went through all the video which you shared and got better understanding earlier I was not aware of microservice and spring boot as well but after going through your video on these now have good hands on this thank you so much for making this wonderful session keep it up 🙂👍
ОтветитьFor who wants to view/get without downloading:
@PostMapping("/upload")
public ResponseData uploadFile(@RequestParam("file") MultipartFile file) throws Exception {
Attachment attachment = null;
String downloadUrl = "";
String viewUrl = "";
attachment = attachmentService.saveAttachment(file);
downloadUrl = ServletUriComponentsBuilder.fromCurrentContextPath()
.path("/download/")
.path(attachment.getId())
.toUriString();
viewUrl = ServletUriComponentsBuilder.fromCurrentContextPath()
.path("/view/")
.path(attachment.getId())
.toUriString();
return new ResponseData(attachment.getFileName(), downloadUrl, viewUrl, file.getContentType(), file.getSize());
}
@GetMapping("/view/{fileId}")
public ResponseEntity<Resource> viewFile(@PathVariable String fileId) throws Exception {
Attachment attachment = attachmentService.getAttachment(fileId);
return ResponseEntity.ok()
.contentType(MediaType.parseMediaType(attachment.getFileType()))
.body(new ByteArrayResource(attachment.getData()));
}
And the response data add the private String viewUrl;
public class ResponseData {
private String fileName;
private String downloadUrl;
private String viewUrl;
private String fileType;
private Long fileSize;
}
how to send form data ,request body and store them in DB using spring boot rest api
Ответитьmake a video for scanning website uri for file download
ОтветитьNot working at the end . Pls help me
Ответитьthere was occuring 406 error, any one can help?
ОтветитьGreat tutorial! Thanks for this. However I have question. Ha to download several images from server? I’ve already broken my brain trying to understand how to do this, and I got nowhere
ОтветитьNice video. Tips for new viewers, if you're using latest spring boot version and MySQL then change the dialect property to org.hibernate.dialect.MySQLDialect and in the Attachment class above the data field add this annotation @Column(name="data", columnDefinition = "LONGBLOB".
Then there will be no error. 😊
First of all I want to congratulate you for the brilliant work! Second, I would like to know if this demonstration of yours is valid (if it serves) for types of files that are in pdf format, mp4 (video format) etc...?
ОтветитьThank you <3
Ответитьwhen i use the download API, It says "Sorry, Photos can not open this file because the format is currently unsupported, or the file is corrupted"
Please help
Nice Video! For usual I habe problems understanding indish accent, but not here!
ОтветитьMan everything is okay? fine but one problem how we can delete a file in multipart file???? can you answer me?
ОтветитьI coded this in Kotlin and it worked fine, but when I upload a PDF, the generated URL doesn't download the PDF file. It just opens it on the web. Any thoughts?
Ответитьwhy you send one parameter file, i need more parameter and how to upload image :D
Ответитьafter watching many tutorial, this was the one who worked for me, THANKS
ОтветитьOMG you're my savior. THANK YOU soooo MUCH!!!!
Ответитьi am getting this while testing upload api == Method Not Allowed
Ответитьhello, great video thank you for your work . where is the video for saving the file in system and save path only because database are mainly not for saving file
Ответитьbro can you add functionality of awsTextract in this video
ОтветитьCan you please do one video on mutiple files for mutliple fields and json using react and spring boot.
ОтветитьThis is very good video...
ОтветитьGood
ОтветитьThanks for such informative and helpful content.
ОтветитьHey Bro. Your intellij idea looks beautiful. What theme are you using? And the video was very important to me.
Ответитьhi, can you please guide on how to convert this file data fetched to readable json format?
ОтветитьHi can you make a video on how authentication and authorisation work in api-gateway
ОтветитьBro Thanks a lot for this session! When I was following your steps I came across Dialect org.hibernate.dialect.MySQL5DialectInnoDBDialect was not supporting in my system so i changed it to org.hibernate.dialect.MySQL5Dialect but was getting below error while creation of the table
java.sql.SQLSyntaxErrorException: Specified key was too long; max key length is 1000 bytes/ fix using mysql workbench
Can u please help to see alternatives for this?
nice tutorial
Ответитьwhy it isnt working for me ? it s directly throwing the exception which is saying could not save file: filename !! But why ?
ОтветитьCan u pls make similar video almost as to how upload download files using azure blob storage using rest api. Also how to upload and download by not using postman , directly from code ( template UI)
ОтветитьThank you
ОтветитьCan you tell about pharmacy management project using spring boot
ОтветитьCan you please create a video on spring batch framework.
ОтветитьBro what is the theme you are using for intellij? please say the name
ОтветитьThank you for your video! I have a question regarding file upload. Maybe someone tries to upload a malicious file. Is there a way to scan the file before we process it? Maybe there is some kind of Java API which could be used to scan the file
Ответитьwhat is propose of creating entity and model within different package?
ОтветитьThanks for the video, it is so useful
ОтветитьHey buddy a small suggestion though. We do not require so many class files just for upload and download. Everything can be done within 3 classes , A repository interface, an entity class, and a Controller. That's all. It's super simple and easy to maintain. At max we would require a DAO file. But not anymore than this
ОтветитьGreat 👍👍👍
ОтветитьGreat tutorial bro 🔥. Do you plain smth about „Spring boot testing Full in Depth”, will be great 🙉🚀
ОтветитьGreat work bro..your video has been very helpful
ОтветитьThank you as always nabbir, i was able to code along, and also used ServletUriComponentsBuilder.fromCurrentRequest when i was getting error with .fromContext. either way i need to study and really understand how it all works. Thanks for the video.
Ответить