I have a question: instead of directly passing a MultipartFile to the API, can I pass a DTO class containing a file (MultipartFile) and a serial number? This way, I'll be able to send multiple files with a sequence number. Consequently, when retrieving these files, I can arrange them in the specified sequence.
Hey! I am dealing with bigger sized images ( around 10-20MB size ) What would be best method of storing it ? Should it store in frontend side and give me the link of stored location? Or should it be handled at backend ? What would be best practice for this case?
Hello Sir, Thank you so much for this valuable knowledge. I am creating apis for news app, there I will fetch all the news in one api call. but to store the image which approach should I follow I am confused. Should I directly upload it in DB or store the URL, please guide me. Thnx once again.
Hello @JavaTechie. Thanks for the great tutorial. I have question regarding test script creation for input file system where I am passing file as queryparam instead of pathparam. What would be the correct approach to test the file input(PDF file), assuming there is no repository since I am taking the input from my local path and performing internal operation on it(for example-take the file and run Post to convert PDF file to word). Kindly suggest. Thank you
If you want to containerize this application and use a Docker Volume, how can you do it? My goal is to have a containerized microservice that is capable to save uploaded files in a volume and its paths in other containerized mysql database with volume. The second part I can do it but the first I don't know how to choose the file location and create the volume. I thought that Resource location it's a good idea but I can't do it. Please HELP...
We can do this buddy , currently i am out of station is this okay if I will share the github or resources after 3 or 4 days ? You can remind me on javatechie4u@gmail.com
Hi sir I have a small doubt if we are storing in a file system approach. How will the retrival happen in realtime applications. My doubt is in realtime the application will be deployed in many VM's for availability reason right. first when we use to upload request to store our images it will be stored on one VM's files system and next time when try to acess the because of loadbalancing we might not hit the same VM right. in that case our image will unaccesable right. how to achieve this. Please forgive me if my queestion/my way of thinking is wrong.
Hello, thank you very much for the video, can I ask a question? how would you store other types of files like pdf, and how do i limit the file size to be sent like 5mb.
Hello @JavaTechie, I am facing the whitelable error while retrieving the image with name This application has no explicit mapping for /error, so you are seeing this as a fallback.
i follow your codes i used String Id instead of name on entity but on GetMapping it returned internal server exemption no value. if you could give a trick to fix it i would be happy
Getting the following error even after increasing request size and file size. getting 415 unspported media type error the request entity has a media type which the server or resource does not support. for example the client uploads an image as image/svg+xml, but the server requires that images use a different format
@@Javatechie configured lombok Installed separate plugins Changed dependencies, gave all the necessary annotations I even imported your project from github to see if it was working but same issue with the .builder function It keeps saying I have to define the function
Thanks you for helping me to learn new features not only for this video but for all other videos .
Thanks for buying me a coffee ☺️
Good content as always, Java Techie!!! Thank you so much, friend!!!
This video helped me a lot. Thank you so much for your amazing content
Great content as always!! I have referred your channel to many of my friends!!
Thanks man! This tutorial is very helpful.
you are a lifesaver, thank you alot.👍💪
Java Techie is the GOAT
Thanks buddy
very good and informative sir
great tutorial. you have been very helpful thanks
Thanks for this tutorial, it so easy to follow and to understand
I am grateful to you, thank you very much for the lesson👋👋👋👋👋👋👋👋👋
Thanks for the tutorial, simple and easy to follow thumb up
great tutorial guy ! simply just like always : awesome!
Thanks for this video!
It worked, Thanks.
Wish you get to 100K subscribers soon 👍
You are Amazing!
Happy teachers day sir 🙏🏻
Thanks Murali 🥰
Thank You very much
thank sir ji
You are a
great
Big thanks sir 🥰🥰🥰
I have a question: instead of directly passing a MultipartFile to the API, can I pass a DTO class containing a file (MultipartFile) and a serial number? This way, I'll be able to send multiple files with a sequence number. Consequently, when retrieving these files, I can arrange them in the specified sequence.
PERFECT!
Thank You SIr
Thank you sir .Please,I want to know what would be the filePath in a production app.
Root/folder in VM
@@Javatechie Thank you ,thank you🙏🙏🙏
@@Javatechie So I think that it would be better to specify the path in the application.properties file
Yes but not in application.properties rather we can specify it in some central place like secret manager or vault or consul
@@Javatechie Ok.It's clear for me, sir.Thank you.
Hey!
I am dealing with bigger sized images ( around 10-20MB size )
What would be best method of storing it ?
Should it store in frontend side and give me the link of stored location? Or should it be handled at backend ?
What would be best practice for this case?
No it needs to be handled in the backend side . Same approach i have followed
@@Javatechie if we upload the file from frontend, we can get the percentage of upload also right?
Hello Sir, Thank you so much for this valuable knowledge.
I am creating apis for news app, there I will fetch all the news in one api call. but to store the image which approach should I follow I am confused.
Should I directly upload it in DB or store the URL, please guide me. Thnx once again.
Follow the same approach that's feasible
@@Javatechie you mean this File system one, right ?
@@aabhasjain96 yes
Hello @JavaTechie. Thanks for the great tutorial. I have question regarding test script creation for input file system where I am passing file as queryparam instead of pathparam. What would be the correct approach to test the file input(PDF file), assuming there is no repository since I am taking the input from my local path and performing internal operation on it(for example-take the file and run Post to convert PDF file to word). Kindly suggest. Thank you
Could make video on downloading millions of data in Excel file without having outofmemory error
You can use fastexcel api for this
If you want to containerize this application and use a Docker Volume, how can you do it?
My goal is to have a containerized microservice that is capable to save uploaded files in a volume and its paths in other containerized mysql database with volume. The second part I can do it but the first I don't know how to choose the file location and create the volume. I thought that Resource location it's a good idea but I can't do it. Please HELP...
We can do this buddy , currently i am out of station is this okay if I will share the github or resources after 3 or 4 days ? You can remind me on javatechie4u@gmail.com
I already sent you an email. This is so important for me... Many thanks for your help! Merry Christmas
Thanks
Hello @JavaTechie, In my case it asking me to create The method Builder() is undefined for the type entity
Configure Lombok in your idea 💡 buddy if it's intellij just install the Lombok plugin
Hi sir I have a small doubt if we are storing in a file system approach. How will the retrival happen in realtime applications. My doubt is in realtime the application will be deployed in many VM's for availability reason right. first when we use to upload request to store our images it will be stored on one VM's files system and next time when try to acess the because of loadbalancing we might not hit the same VM right. in that case our image will unaccesable right. how to achieve this. Please forgive me if my queestion/my way of thinking is wrong.
You need to automate directory creation in each vm . The way we are doing for logs management
@@Javatechie is there any video logs in your channel sir, If yes can you please share the link I will go through t
No i don't have any video regarding this buddy
You can store it in the Cloud I think.
Hello, thank you very much for the video, can I ask a question?
how would you store other types of files like pdf, and how do i limit the file size to be sent like 5mb.
spring.servlet.multipart.max-file-size=5MB
spring.servlet.multipart.max-request-size=5MB use these properties in the application.properties
Could u make a video on Swagger and how to use in microservices
Already uploaded multiple videos about swagger documentation please search with keyword "documentation"
Can you please make a video on how to write search operations in spring boot
thank youuu
Hello @JavaTechie, I am facing the whitelable error while retrieving the image with name
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Okay are you hitting the correct url ? Can you validate whether your server is coming up or not?
can you please extend the video and encrypt the file on the storage (file system) so it will be secured
then decrypt it while downloading
Yes in image utility we have the method, you can use the same code
@@Javatechie
I mean encrypt the file so no one can open it even he accessed the storage
How to do the same but for json post request, convert it into base 64?
Sir do you have videos on Rest api development from java on your channel pls give me link
Yes buddy using spring boot i uploaded a couple of videos please check out my spring boot playlist
@@Javatechie ok thnx
Can we upload video and other file type too in such way
Yes we can
i follow your codes i used String Id instead of name on entity
but on GetMapping it returned internal server exemption no value. if you could give a trick to fix it i would be happy
I am not getting you . What error you are getting paste here
How can we store image on cloud and then save that file_path to database?
Brother after insert images into db can I delete that image on my local mechine
Yes you can while inserting only take the path and do File.delete method
@@Javatechie thanks
Getting the following error even after increasing request size and file size.
getting 415 unspported media type error
the request entity has a media type which the server or resource does not support. for example the client uploads an image as image/svg+xml, but the server requires that images use a different format
Is their any way to store the file in server side and the storage location in database
i used the file system approach and stored the file in the application itself but when i tried to package the file it didnt work
Hi, would like to know that how can we use this method for PDF
How to upload list of photo..
Please sir make a video
can we use this for video upload ?
sir please can you recreate this in mongodb
Sir after hosting the app this code doesn’t work
Expecting a cloud storage solution video next time.
Yes
It's already there using S3
Please check out the below 👇 link both of you th-cam.com/video/vY7c7k8xmKE/w-d-xo.html
Can you teach us about AWS textract in spring boot
Here is the playlist link please refer AWS (Amazon Web Services): th-cam.com/play/PLVz2XdJiJQxxurKT1Dqz6rmiMuZNdClqv.html
issue while using png image in downloadImage method response status is 200 but cant see image
No it shouldn't be any issues, are you getting any exception in logs or console?
no error i have just removed the compress and decompress methods
@@Javatechie
@ResponseStatus(HttpStatus.FOUND)
@GetMapping("/get-file")
public ResponseEntity getImage(@RequestParam Long id){
byte[] downloadImage = mediaService.downloadImage(id);
return ResponseEntity.status(HttpStatus.OK)
.contentType(MediaType.valueOf("image/png"))
.body(downloadImage);
}
@Transactional
public byte[] downloadImage(Long id) {
MediaFile imageData = mediaRepository.getMediaFile(id).stream().findFirst().orElse(null);
if (Objects.nonNull(imageData)) {
return imageData.getFileData();
} else {
return new byte[]{};
}
}
.contentType(MediaType.valueOf("image/png")) this thing makes the content type static ?
that .builder function doesnt work for me
Please configure Lombok in your ide
@@Javatechie configured lombok
Installed separate plugins
Changed dependencies, gave all the necessary annotations
I even imported your project from github to see if it was working but same issue with the .builder function
It keeps saying I have to define the function
how to show all images in html page
can anyone help with this ?
please help ASAP
sorry bro, i apologize
For what buddy?