hello
i am in need to upload multiple files. help me.......
Hi,
For uploading multiple files.. u may use scanners..
I have tried out one sample example wit that,it works fine..
import java.io.*;
import java.util.*;
class MultipleFiles{
public static void main(String args[]){
System.out.println("Enter the number of files to upload::::::::::");
Scanner sc = new Scanner(System.in);
int i = sc.nextInt();
System.out.println("Enter the file names to upload::::::::::");
try{
for(int j=0;j<i;j++) {
String fileName = (String)sc.next();
File file = new File(fileName);
FileReader reader = new FileReader(file);
BufferedReader buff = new BufferedReader(reader);
String str = null;
StringBuffer strBuff = new StringBuffer();
while( (str=buff.readLine()) != null){
strBuff.append(str);
}
System.out.println("Uploaded File contents::::::::::::::: : "+strBuff);
}}
catch(Exception e){
e.printStackTrace();
}}}
Am i undersatnding ur query in rt way?
-Thanks
Hamsa