We have an application running on a single instance servlet engine.
I want to move single server approach to our weblogic cluster to upload and validate excel files. I am trying to find out a way to store the uploaded files in the file system before starting to read and validate the data.
Do you have any ideas?
Regards,
Koray
-
EJB Cluster & File uploads (3 messages)
- Posted by: koray guclu
- Posted on: October 07 2004 08:10 EDT
Threaded Messages (3)
- EJB Cluster & File uploads by Stefano Crespi on October 07 2004 09:22 EDT
- EJB Clustering and temp directory by koray guclu on October 12 2004 10:02 EDT
- EJB Clustering and temp directory by Jose Ramon Huerga Ayuso on October 15 2004 01:30 EDT
- EJB Clustering and temp directory by koray guclu on October 12 2004 10:02 EDT
-
EJB Cluster & File uploads[ Go to top ]
- Posted by: Stefano Crespi
- Posted on: October 07 2004 09:22 EDT
- in response to koray guclu
this code fragment works on Bea Portal 7 but will work on WLS only changing the multi part parser section
try {
MultipartParser parser = new MultipartParser(req);
Part part = parser.readNextPart();
while (part != null)
{
if (part.getName().equals("fileRS") && part.isFile())
{
filePart = (FilePart) part;
tmpFile = File.createTempFile("tmpRS",".zip");
tempFileName = tmpFile.getAbsolutePath();
filePart.writeTo(tmpFile);
tmpFile.close();
break;
}
part = parser.readNextPart();
}
examineUploadedFile(tempFileName);
if (tmpFile != null)
tmpFile.delete();
}
catch (IOException ex) {
log.error("Error processing uploaded file",ex);
throw new ProcessingException(ex);
}
Bye, Stefano -
EJB Clustering and temp directory[ Go to top ]
- Posted by: koray guclu
- Posted on: October 12 2004 10:02 EDT
- in response to Stefano Crespi
I use temp directory if I use clustering (disteributed to the different computers) will i get always the same locaation for the temp directory?
I mean will it be always the same computer and the same temp directory that i am getting? -
EJB Clustering and temp directory[ Go to top ]
- Posted by: Jose Ramon Huerga Ayuso
- Posted on: October 15 2004 13:30 EDT
- in response to koray guclu
I use temp directory if I use clustering (disteributed to the different computers) will i get always the same locaation for the temp directory? I mean will it be always the same computer and the same temp directory that i am getting?
If you plan to upload files to a cluster, you must validate that the filesystem where you store the files is shared across all the machines that form the cluster. For example, if you are saving the excel files in a directory of one of the machines such as....
/apps/uploadedFiles
... you must share this directory via NFS in order to mount this directory in the other machines of the cluster. If you don't do this, then maybe you are going to get errors if for example you upload a file with one server of the cluster, and then - a week ago - you try to read this file, but the request gets served by other machine of the cluster.
Jose R.
http://www.terra.es/personal/jrhuerga