Win a copy of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 this week in the Programmer Certification forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

File Upload from form

 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I know how to browse files in html form.( with input type = file.)
but how do I upload this file on to a server where my servlet can access/read/save it.
any ideas?
Thanks
 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<input type="file">
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Seema,
What u can do is u can use the MultipartRequest class which oreilly gives u. Just go to the site www.oreilly.com, get the cos.jar file, include it in ur classpath and then access the MultipartRequest class to upload the files.
Another way is to use the FileInputStream, the first one is better.
Sanket.

Originally posted by Seema Das:
Hi,
I know how to browse files in html form.( with input type = file.)
but how do I upload this file on to a server where my servlet can access/read/save it.
any ideas?
Thanks


 
Seema Das
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Sanket! I will try it out!
 
Seema Das
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,
I am not able to find any classes on oreilly.com. As Sanket has suggested, I am trying to get the cos.jar for file upload. Could someone give me the exact URL for it?
Thanks
 
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

the website is http://www.oreilly.com/
without the comma.....
- satya
 
Seema Das
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well, I am sorry if I am not clear enough. I found the site, I then went to onjava.com, did search for cos.jar as well as for MultiPartRequest class but didn't find the class or jar file which I want to download.
So I want to know the exact url where I can find the class for file upload.
Thanks
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
easier to find it here: http://www.servlets.com/cos/index.html
 
Seema Das
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks!
 
sanket more
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Seema,
Did u manage to solve the probs?...
chau
 
I'm so happy! And I wish to make this tiny ad happy too:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!