Voltei para apontar onde está o erro que todo mundo está falando e o motivo das imagens não abrirem depois do upload. A instância: is.read(); do método uploadFile, tem que receber a variável byt… ou seja, ela deve ficar desse jeito: is.read(byt).
hey i want to get the name of user & img at same time i have already used this but my code is showing null null values why? and if not null then it is showing nothing? plz help
Hello, thank u for the tutorial. I uploaded the xml file that have tags and contents but after that I checked the file which is empty, the file has nothing in it. Can you help me pls. Thank u
can you add a code for an admin can upload videos/movies to the page and user can download them(only download.no stream able) . Something like a movie down-loader web page or Netflix
@@TechTutorialCN Hello sir. con you do this tutorial before 24th of April please . I really need this kind of a video before 25th for to do a project. Because of lockdown there is no one to help.
Same issue! I did it this way String path= getServletContext().getRealPath("/Files"+File.separator+fileName); but I sends the data to another directory and once the date is in that directory I could not open anything
Hello sir. I too uploaded the image using the same way and it got uploaded too. But I want to access the image from jsp using img tag and since the BUILD folder is not accessible from the IDE and after deployment of project using of absolute path can cause problems. So what is the solution to it??
You don’t need to use the build path folder. Use your regular folder location in your “web” directory. You can access those image if the image not present in that directory, but present in build directory.
Hello can u make a video of how to populate one drop down list based on a previous drop down list that fetched its value from database. Example: country and state.. And those option values should come from the database. Using only jsp and javascript and mysql. Please it is urgent. Searching for this since a long but nothing helped. Thanks!
Hi if you use netbeans it will create automatically doGet and doPost method below the procesrequest method. Or you can create doPost method by own self
I solved it. And another problem is when clean & build project it will delete image which i just upload. How to avoid delete image that just upload when clean & build
Thank you very much! You showed me how to save an image. I was been search for this for a week! You made my submission possible!
I am glad that it’s helpful to you 🥰
very usefull video, thankYou very much,i wish you every thing be succes!!!
Thank you so much 😊
Thanks a lot , very useful
Unchecked exceptions come sir how to fix
Voltei para apontar onde está o erro que todo mundo está falando e o motivo das imagens não abrirem depois do upload.
A instância: is.read(); do método uploadFile, tem que receber a variável byt… ou seja, ela deve ficar desse jeito: is.read(byt).
hey i want to get the name of user & img at same time i have already used this but my code is showing null null values why? and if not null then it is showing nothing? plz help
Sorry I didn’t get your point.
sir i have upload the file in directory of eclipse but it showing looks like don't support format so what can i do im trying since 4 days
Think there is an issue with file read and write. you can share your GitHub resource. I will take a look.
@@TechTutorialCN im unable to push the project to git hub resource here im sending the code
String filename=part.getSubmittedFileName();
String path=getServletContext().getRealPath("img"+File.separator+"products"+File.separator+filename);
System.out.println(path);
InputStream is=part.getInputStream();
byte [] data=new byte[is.available()];
is.read();
FileOutputStream fos= new FileOutputStream(path);
fos.write(data);
fos.flush();
fos.close();
Remove this line : System.out.println(path):
@@TechTutorialCN not i have solved that problem just have to add
is.read(data); // pass here bytr array name to read the input thank u
@@akadeadahot7067 you are welcome
Sir I m getting issues with image
When I m openning image in folder it is no opening and snowing this format is not supported
You can use Apache common file upload jar file.
I'm also facing this problem..I can't open the stored image file.. I'm using apache common file upload jar.
Could u help me, user part android, server part jsp.
How to upload image
You mean you want to upload image in android app development using java?
@@TechTutorialCN yes
@@TechTutorialCN could u pls help...
@@vadakkanchottanikara I have no practice with android since my 3rd year in university. I think the backend process will be the same.
No.. dear.
Did u get time pls help
Hello, thank u for the tutorial. I uploaded the xml file that have tags and contents but after that I checked the file which is empty, the file has nothing in it. Can you help me pls. Thank u
My May mention the char type
can you add a code for an admin can upload videos/movies to the page and user can download them(only download.no stream able) . Something like a movie down-loader web page or Netflix
hi, dear thanks for your comment. in next video i will explain that. for that please subscribe my channel and turn notification to get the update.
@@TechTutorialCN Hello sir. con you do this tutorial before 24th of April please . I really need this kind of a video before 25th for to do a project. Because of lockdown there is no one to help.
I will try my best. I am also working on my research paper. And extremely busy. But I will try to do that for you.❤️
@@TechTutorialCN thankyou so much Sir
In my ECLIPSE IDE,I am unable to find getPart method ,due to which unable to upload file as explained in this video,please suggest
Please make sure that you choose jsp version 3.0 or above on project creation time.
@@TechTutorialCN where is that option available?
it is not working the path is showing null, how can i resolve it
Please check the context path and also the folder directory
Great Tutorial! I had some issues like the persons in the comments but in general it is a good video
Thanks for your comment. It's sorry to hear from you are getting an issue. I hope it solved. If not feel free to comment.
@@TechTutorialCN what to do if you wanna save this file to your projects web Content
I didn’t get you properly.
@@TechTutorialCN i want to upload this files to
-webcontent
--file folder
in my project
I am working in eclipse
getServetContext().getRealPath() it will return your web content folder
Suppose their is a excel file to upload and save Excel files data to table in MySQL what to do
First you need to read the excel file data and then separate the data. Finally send those data to database according to the column name.
Sir, String path = getServletContext().getRealPath("/"+"files"+File.separator+fileName); = null
did you create the folder name "files" in your directory?
Please check that you create the folder in your web directory
@@mihigoyves what's the issue again?
Same issue! I did it this way String path= getServletContext().getRealPath("/Files"+File.separator+fileName); but I sends the data to another directory and once the date is in that directory I could not open anything
@@TechTutorialCN same issue..its returning null
is.read(byt); //instead of is.read();
Nice brooo!!!
thanks bro it works now
Hello sir. I too uploaded the image using the same way and it got uploaded too. But I want to access the image from jsp using img tag and since the BUILD folder is not accessible from the IDE and after deployment of project using of absolute path can cause problems. So what is the solution to it??
You don’t need to use the build path folder. Use your regular folder location in your “web” directory. You can access those image if the image not present in that directory, but present in build directory.
Hello can u make a video of how to populate one drop down list based on a previous drop down list that fetched its value from database. Example: country and state.. And those option values should come from the database. Using only jsp and javascript and mysql.
Please it is urgent. Searching for this since a long but nothing helped. Thanks!
Hey, thanks for your comment. I will upload it as soon as possible.
hello bhai file ka path null aa raha he mera plc kay karu me file uplode nahi ho rahi he
Please double check the context path
where is the database connection and where you upload data in database sir
File uploaded in a files directory
Sir FileNotFoundExcption occurs
File mane save database but img file not write in web project folder
WebContent->img
please check your path string. and inputstream
Will it work in deployment so end users can upload any download files?
Yes 👍
Where is the doPost method? Getting an error while using do post and calling process request.
Hi if you use netbeans it will create automatically doGet and doPost method below the procesrequest method. Or you can create doPost method by own self
Sir, after i upload, then i go to the files and open the pdf, the pdf cannot be open
Might be the stream was not converted properly.
@@TechTutorialCN then, how to fix it?
Try another file and check if it's working or not.
@@TechTutorialCN other file also have the same problem such as pdf, image and others. How to fix ya?
help me sir
thank u i did it ^^ but i can not open the file after moving it there . help me pls
What error you are getting?
which jdk u working with
Java SE 13( JDK 1.8)
Thank you soo much!!
You are welcome
how can I retrieve the image to display it in a jsp page?
As usually you shoe image to html page. Use
@@TechTutorialCN yes. I need help with the path specifically. How will the image path look like
An example would be great. Thanks
/folder-name/image-name.jpg like that
@@TechTutorialCN tried this and I get a 404 error.. Request not found. Yet the image has already been uploaded to the folder
Check the path properly. Go to your build folder to check if the image exists there or not.
Do we require any Jar files for running
No need any jar file.
@@TechTutorialCN thanks for the information
Appreciate to help you. Don’t forget to subscribe 🙂
Very thanksfull bro
glad to hear from u. I wish you subscribe to my channel.
Sir please upload "update image file " video
Alright, I will.
Sir file images open nhi ho rhi uploading ke baad
Sir file to ko display kaise kare images on JSP page
In webpage or in your computer?
Sir image upload karne ke baad ye corrupt ho ja rhi hai
Open hi nhi hori file
Source Code please....
getSubmittedFileName mai error hai
Means error aa rhi hai
What’s the error you are getting?
@@TechTutorialCN thanks sir but i solved my wrror.
This error because of my tomcat 7 and now i download the tomcat 8
😊
if i upload the same file, how to delete existing file before write(file)
Write a logic that will search the file if exist then delete, then upload the file
I solved it. And another problem is when clean & build project it will delete image which i just upload. How to avoid delete image that just upload when clean & build