I am trying to copy files fron the server to local machine, This code is not giving error while execution but I am not able to see file getting copied on my local machine
Probabaly file is getting copied on the server only.
Can anybody tell, how can I know where the file is getting copied & How I can copy it to a Local folder?
Your code is transferring data via HTTP, something you aren't going to be able to do locally unless you are running a web server configured to receive an upload.
You probably want to do something like this or these examples.
I'm sorry. I totally read your code wrong. Your code accesses a URL and copies the resource locally. If you are having a problem, there's a couple of things that can go wrong. Does the directory c:\temp exist and do you have permission to write to it? Can you open the URL you are trying to download in a browser? Do you print out possible exceptions?
I have got permission to copy that file to folder to locam machine & Temp folder exist in the C drive.
I can open the URL in the browser.
When I run this code I dont get any exceptions (I checked printing sysouts till the end of the code, it runs without exceptions & errors) but I am not able to find out where this file is getting copied.
Your code works fine for me. I ran into a glitch in Ubuntu where the file was saved to the current working directory, but on Windows it performed as expected, downloading an image and saving it to c:\temp\testplans1.jpg
Do you have to log into a web application to view the file you are downloading?
No I dont have to Log on to web application to view the files I am downloading. When I run the code from eclipse on my local machine then it works fine& I can see the file created in Temp folder in C: drive but when I deploy the code on the weblogic server then I dont get the location where the file is getting stored, I doubt whether it is getting stored on server's directory
If I want to allow user to download all the files from server with a single button click is there any other way than making a zip file of all the files & presenting to user??
(I know the URL of the all the files I want to download & there are other files also in the same folder from which I want to download my files)