Richard Brown
|
Posted: 10/17/2005, 6:55 AM |
|
I have a record form with 3 FileUpload components. When I do an insert only the file from the first FileUpload component is uploaded. The other 2 files are not.
Has anyone overcome this problem/limitation, if so how?
|
|
|
eserver221
|
Posted: 10/18/2005, 8:23 PM |
|
Actually, the other two files were put in the temporary directory. I do not know whether it is a bug or you used a trial version. You can add a custom server event to fix it.
|
|
|
Richard Brown
|
Posted: 10/21/2005, 12:49 AM |
|
I've overcome the problem by using the method shown in the CCS Example Pack 2. I just do uploads one at a time.
|
|
|
Ravinder.R
|
Posted: 11/07/2005, 2:43 PM |
|
<%@ page import="java.sql.*,java.util.*,java.io.*"%>
<%
try
{
String newPath1="";
String newPath2="";
String strPath1=request.getParameter("file1");
String strPath2=request.getParameter("file2");
if(strPath1!=null)
{
ArrayList arr1=new ArrayList();
ArrayList arr2=new ArrayList();
int count1=0;
int count2=0;
StringTokenizer st1=new StringTokenizer(strPath1,"\\");
StringTokenizer st2=new StringTokenizer(strPath2,"\\");
while(st1.hasMoreTokens())
{
arr1.add(count1,st1.nextToken());
count1++;
}
while(st2.hasMoreTokens())
{
arr2.add(count2,st2.nextToken());
count2++;
}
int c1;
newPath1="C:/jboss/server/default/deploy/Ravii.war/FileUploaded/"+ arr1.get(count1-1).toString();
newPath2="C:/jboss/server/default/deploy/Ravii.war/FileUploaded/"+ arr2.get(count2-1).toString();
FileInputStream fis1=new FileInputStream(strPath1);
FileOutputStream fos1=new FileOutputStream(newPath1);
while((c1=fis1.read())!=-1)
{
fos1.write((char)c1);
}
int c2;
FileInputStream fis2=new FileInputStream(strPath2);
FileOutputStream fos2=new FileOutputStream(newPath2);
while((c2=fis2.read())!=-1)
{
fos2.write((char)c2);
}
}
out.println("Thanks for using");
out.println("<br>");
out.println("<br>");
out.println("1.File1 Uploaded from :: "+strPath1);
out.println("<br>");
out.println("<br>");
out.println("2.Uploaded File1 is Saved in :: "+newPath1);
out.println("1.File2 Uploaded from :: "+strPath2);
out.println("<br>");
out.println("<br>");
out.println("2.Uploaded File2 is Saved in :: "+newPath2);
}
catch(IOException e)
{
out.println("exception"+e);
}
%>
</head>
</html>
|
|
|
|