Quantcast
Channel: SCN : Popular Discussions - Web Dynpro Java
Viewing all articles
Browse latest Browse all 989

File Not Found Exception :: File Upload

$
0
0

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.....


Viewing all articles
Browse latest Browse all 989

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>