cancel
Showing results for 
Search instead for 
Did you mean: 

File Not Found Exception :: File Upload

former_member222013
Participant
0 Kudos

Hi,

I am using File Upload functionality to upload a file to the server temporarily and then reading it again back ..

I am using the below code to upload the file to the server..,

int temp = 0;

  File f = new File(wdContext.currentcontextElement().getFileResource().getResourceName().toString());

  FileOutputStream fos = new FileOutputStream(f);

  if(wdContext.currentcontextElement().getFileResource() != null)

  {

  InputStream stream = wdContext.currentcontextElement().getFileResource().read(false);

  while((temp = stream.read()) != -1)

  {

  fos.write(temp);

  }

  }

  fos.flush();

  fos.close();

  path = f.getAbsolutePath();

When I try to read the file from the above path I am getting the File not found exception ....

The above code works fine in Dev but having issues in Q . Any particular reasons ???? Any help would be highly appreciated ....

Thanks.....

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

The exception is totally direct -  the file is not in the required path.

See if the file is available on the path mentioned by Vijay.

regards,

Ashvin

former_member197472
Active Participant
0 Kudos

Check permissions on your INT server, whether it allows upload or not

--

Rregards,

Amey

vijay_kumar49
Active Contributor
0 Kudos

Hello,

Path is:- C:\usr\sap\SID\JC Instance\j2ee\cluster\server0

Check wether the  file is avaliable or not in Server0 Path.