Results 1 to 1 of 1
- 07-12-2010, 10:26 AM #1Member
- Join Date
- Jul 2010
- Rep Power
File transfer to be shown in progressbar
I am now working on a progress bar work.
The requirement is when the file transfer will start(as of now assume transferring taking place in the Hard Disk, from a drive to another),the amount of data that will be transferred will be shown in percentage/Kb in a progress Bar.
servlet class for handle the file write to destination folder.
The approach i have followed is
//request send from here
3) //request has sent to servlet file
////destination file is mapped.the size is checked.And showing in the progress bar by a calculation
//progress bar code here
7) //jsp file got the msg here (to start checking the amount of data exist in the destination file)
7.1) //call a method so that in regular interval checkdata() will be called.
//And once file transfer finished progress, bar show msg as "complete" & disappear.
(to work in regular interval setInterval(checkData(),100) is called.)
//)file button(select the file u want to copy to the destination path)
//) text field(to fill the destination path)
1 //) copy button(mind it that it is a Button not a Submit btn) its onlick= copyFile()
//progressBar code here
---------------------end of jsp file----------------------
4) // request come from jsp
//check for source file
5) //create a file with the same name in the destination folder(as of now it is empty)
6) //send a msg to jsp file (to start checking how much amount of data exist in the destination file) through ajax.
6.1) //call a function written for file copy.
//once filecopy complete give a msg on console that file "copying has ben complete"
-------------the end of java file----------------------------
here everything is working fine.div showing how much data is currently in the file
what is the problem is that
the when i start copying the file, upto 6.1) is working fine.Then progress bar showing directly "complte" as msg
Then if i again press the copybutton in jsp then the progress bar properly showing the ammount of data in proper intervaland increase properly.At this time the file is fully in the destination folder.But i have checked from the dest.. folder that again the size of file start to increse from 0 kb.
So do send msg for this problem
- By cheng in forum New To JavaReplies: 0Last Post: 12-14-2009, 04:42 AM
- By prashant in forum NetworkingReplies: 3Last Post: 12-10-2009, 06:46 AM
- By manabendra in forum NetworkingReplies: 2Last Post: 08-07-2009, 07:51 AM
- By ddj in forum NetworkingReplies: 2Last Post: 03-20-2009, 02:10 PM
- By lks0912 in forum Advanced JavaReplies: 0Last Post: 10-23-2008, 12:53 PM