Santosh Kumar

Ranch Hand
+ Follow
since May 25, 2005
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Santosh Kumar

hi

thanks a ton for the information
can you tell me how to go ahead to prepare myself for the interview
do you have any interveiw FAQ's..if do please let me know


regards
santosh
10 years ago
hi

i am having 3+yrs of experience in java/j2ee but
i am a fresher for ibm portal.i need help to start with portals. can anyone please help me out with the tutorial or material to start with.i would like to know how can i go ahead as a starter.

your suggestions and efforts will be appreciated.

waiting for your reply


regards
santosh
10 years ago
hi

i am working on java applications on Windows NT
can anyone tell me how to use java on Macintosh operating system.
will it be possible to run java applications on Mac OS
how can i do that


waiting for your valuable suggestions.


regards
santosh
11 years ago
hi

i am working on java applications on Windows NT
can anyone tell me how to use java on Macintosh operating system.
will it be possible to run java applications on Mac OS
how can i do that


waiting for your valuable suggestions.


regards
santosh
11 years ago
hi vivek

can u tell me where is this package MultipartFormDataRequest
can u give me some more info on this please

MultipartFormDataRequest mrequest=new MultipartFormDataRequest(request);
String name=mrequest.getParameter("Name");

waiting for your reply

regards
santosh
12 years ago
JSP
yes
what you said is right
i want the user to select the directory on the server.for that reason i provide a dropdown box with the directory names.
once the user selects the directory name in the dropbox along with the file to be uploaded and says submit the file has to be uploaded to that particular directory on the server.

how to go with it
waiting for your reply


regards
santosh
12 years ago
JSP
hi

i am getting the form field values using that code
the thing is when i check for the directory name existing on the system and the dirctory name selected by the user to be same and try to upload the file if both are equal
i am not able to upload the file and also not able to check the directory names

what could be the problem
12 years ago
JSP
i've already used what you said in my code
i wanted to send the user selected value and the file name to be uploaded together to the jsp page
once this is done i can upload the file to that particular directory.

does the making of html pages to jsp make any difference
12 years ago
JSP
hi

what i am doing is allowing the user to upload file from local system to the remote server...this works fine if i hardcode the path
but when i want to upload to a particular directory on the server..i need to allow user to select the dir
now i have the prob in passing the dir name in the html to jsp
u can see the code above..both html and jsp for reference

what to do
12 years ago
JSP
hi


i've done that, you can see that in the code above
the thing is, i need to upload the file depending upon the selection from the dropdown box by the user
how can i do that.

regards
santosh
12 years ago
JSP
hi

thanks for the info
i've seen the doc, is there any other possibility to catch the values from html in jsp.
can it be done using some scripts

waiting for your reply


regards
santosh
12 years ago
JSP
hi

i am using the apache fileupload itself
my html code is

upload.html
---------------

<html>
<head>
<title>Upload File...</title>

</head>
<body>
<FORM name="loadfile" ACTION="file_upload1.jsp" ENCTYPE="multipart/form-data" METHOD="POST">
<table width="87%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="21%"> </td>
<td width="40%">Which file do you want to upload ?......</td>
<td width="12%"><INPUT TYPE=FILE NAME=fileload></td>
<td width="27%"> </td>
<td width="0%"> </td>
</tr>
<tr>
<td>  </td>
<td>Select the Category to upload file .......</td>
<td><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
<select name="select_load" >
<option value="io">I/O</option>
<option value="memory">Memory</option>
<option value="testchips">Test Chips</option>
<option value="stdcell">Standard Cell</option>
<option value="general">General</option>
</select>
</font></td>
<td> </td>
<td> </td>
</tr>

<tr>
<td> </td>
<td> </td>
<td><INPUT name="SUBMIT" TYPE=SUBMIT></td>
<td> </td>
<td> </td>
</tr>
</table>
<p> </p>
<p> </p>
<p>  </p>
<p><font size="2" face="Verdana, Arial, Helvetica, sans-serif"> </font></p>
<p><BR>
</p>
</FORM>
</body>
</html>


jsp page is

file_upload1.jsp
--------------------
<%@ page import="java.util.*,java.io.*,org.apache.commons.fileupload.*" %>

<HTML>
<BODY>
<%

String cat_load="";
String loadtext="";
if(request.getParameter("select_load")!=null)
{
cat_load=(String)((request.getParameter("select_load")).trim());
}


out.print("...........1"+cat_load+"<br>");
out.print(cat_load.equalsIgnoreCase("General"));

if(cat_load.equalsIgnoreCase("general"))
{
out.println("inside if");

try {

out.print("inside try</b><br>");
// Create a new file upload handler

DiskFileUpload upload = new DiskFileUpload();

// Set upload parameters
// set memory size allowed to the uploading (optional)
// upload.setSizeThreshold(2000);
// set a directory to temporarily upload the file if
// the last memory size in insufficient (optional) :
// upload.setRepositoryPath("c:/temp");
// set the max uploaded file size (-1 for no max size)
upload.setSizeMax(-1);

// Parse the request
List items = upload.parseRequest(request);

// Process the uploaded items
Iterator iter = items.iterator();

while (iter.hasNext())
{
FileItem item = (FileItem) iter.next();
if (item.isFormField())
{
// the item is not a file item
String name = item.getFieldName();
String value = item.getString();
out.print("item :<b>"+name+"</b> value:<b>"+value+"</b><hr>");
}
else
{
// the item is a file item
String fieldName = item.getFieldName();
String fileName = item.getName();
String contentType = item.getContentType();
boolean isInMemory = item.isInMemory();
long sizeInBytes = item.getSize();

out.print("item :<b>"+fieldName+"</b><br>");
out.print(" file :<b>"+fileName+"</b><br>");
out.print(" content type :<b>"+contentType+"</b><br>");
out.print(" in memory ? :<b>"+isInMemory+"</b><br>");
out.print(" size:<b>"+sizeInBytes+"</b> bits<br>");
out.print("fileName :<b>"+fileName+"</b><br>");

fileName = fileName.substring(fileName.lastIndexOf("\\")+1);
out.print("fileName :<b>"+fileName+"</b><br>");
String destFile="\\\\server1\\temp\\"+fileName;
out.print(" destFile:<b>"+destFile+"</b><br>");

// copy the file to disk
File uploadedFile = new File(destFile);
item.write(uploadedFile);
out.print(" file uploaded to : <b>"+ destFile +"<br>");
}
}//while end
}//try end
catch (FileUploadBase.SizeLimitExceededException e)
{
out.print("COMMONS error : maximum file size exceeded");
}
catch (FileUploadException e)
{
out.print("COMMONS error :"+ e.toString());
}
catch (Exception e)
{
out.print("error :"+ e.toString());
}
}

%>

</BODY>
</HTML>



jsut check out these and let me know
waiting for ur reply



regards
santosh
12 years ago
JSP
hi

thanks for the relpy
yes i am getting null value then how can i handle this
i need to send values from html which has ENCTYPE to jsp page
how can this be done


waiting for your reply

regards
santosh
12 years ago
JSP
hi

i am uploading a file to remote system
i need to send some values from html to jsp
in the html i am using the form tag as

<FORM name="loadfile" ACTION="file_upload1.jsp" ENCTYPE="multipart/form-data" METHOD="POST">

i am not able to pass values from html to jsp when
the ENCTYPE is used in the form tag
when i remove the ENCTYPE i am able to pass the values to jsp

how to solve this problem
waiting for your valuable suggestions



regards
santosh
12 years ago
JSP
hi

i am using apache tomcat server 5.0.28
i am trying to write files to a remote system, the code is working fine if the folder on the remote server is shared.
but when i am trying to write to a folder on some remote system its giving an error saying that user login to remote system is denied
is it related to the configuration of tomcat settings.
do i need to change any settings in tomcat

help me out in solving the problem

waiting for your reply



regards
santosh
12 years ago