wood burning stoves 2.0*
The moose likes Servlets and the fly likes to know the contents uploaded by the upload component Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "to know the contents uploaded by the upload component" Watch "to know the contents uploaded by the upload component" New topic
Author

to know the contents uploaded by the upload component

arvind
Greenhorn

Joined: Aug 27, 2001
Posts: 11
I have been successfully able to execute the upload component of oreilly and been able to upload components in a desired folder.I want to get the information of the material that has been uploaded so that i am able to save it in the database for future references,Please help
arvind
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

do you mean the filename that was uploaded?

it's available as a method on MultipartRequest
arvind
Greenhorn

Joined: Aug 27, 2001
Posts: 11
hi,
i am using the upload component of oreilly and being successfully able to upload a component to a desired folder.The problem i am facing is that when i upload a particular image/file i want the name of image/file to be inserted in a database so that i can call it later as to when required.for e.g i want to upload test.htm in a particular folder like yogesh. The path of the file will be(..\test.htm). the test.htm is successfully uploaded to a folder but i want the test.htm to be inserted a database say xyz which has a table called test with fields like name,image and so on. I would like to have my test.htm to be inserted in the table test in it's field image.
Rahul Mahindrakar
Ranch Hand

Joined: Jul 28, 2000
Posts: 1850
"arvind"

Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp . We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please log in with a new name which meets the requirements.
Thanks.
------------------

Mahindrakar
IBM Application Server & Developer Forum Moderator

Consultant - Zensar Technologies ,Pune India.
SCJP2, SCJD2 & SCJEA (Part I)
Yogen Vadnere
Ranch Hand

Joined: Sep 20, 2001
Posts: 58
Here is the code to get the file name..and then u can insert whereever u want..
MultipartRequest multi = new MultipartRequest(request, "/uploadsfile", 1024*1024);
String filename = multi.getParameter("filefield");

Hope this will help u.


Yogen Vadnere
 
GeeCON Prague 2014
 
subject: to know the contents uploaded by the upload component