File upload
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   amol_vaidya
Posted On:   Sunday, February 15, 2004 10:08 PM

Hi i want to upload a filefrom a windows system in LAN to a Linux server.My program is running on Linux.I tried it by mounting the windows folder to Linux but it doesn't work.It gives java.io.FileNotFoundException. String fileName = "/mnt/xyz/ABC.doc"; System.out.println("trying to read file :"+fileName); File f = new File(fileName); FileInputStream in = new FileInputStream(f); File out = new File("/opt/jakarta-tomcat-4.1.18/webapps/ABC.doc"); FileOutputStream outStream = new FileOutputStream(out); int c = 0; byte []inArray = new byte[in.available()]; do{ c = in.read()   More>>

Hi i want to upload a filefrom a windows system in LAN to a Linux server.My program is running on Linux.I tried it by mounting the windows folder to Linux but it doesn't work.It gives java.io.FileNotFoundException.


String fileName = "/mnt/xyz/ABC.doc";

System.out.println("trying to read file :"+fileName);

File f = new File(fileName);

FileInputStream in = new FileInputStream(f);



File out = new File("/opt/jakarta-tomcat-4.1.18/webapps/ABC.doc");



FileOutputStream outStream = new FileOutputStream(out);



int c = 0;


byte []inArray = new byte[in.available()];

do{

c = in.read();

outStream.write(c);

}while(c != -1);

}

catch(FileNotFoundException fe){ System.out.println("FileNotFoundException");}

catch(IOException e){ System.out.println("Exception"+e);}



Here, /mnt/xyz is the mounted place that matches with my windows folder.


Can anyone helpm me.Its urgent.

Thanks.

   <<Less

Re: File upload

Posted By:   Zac_Jacobson  
Posted On:   Tuesday, February 17, 2004 11:48 AM

Does the user you're running your program with have read-access to /mnt/xyz/ABC.doc?
About | Sitemap | Contact