Search code examples
phpjquerycopying

php and jQuery, copying files and displaying status


I'd like to ask if this 'synchronizing-scenario' is possible with php and javascript/jQuery...

I have a lots of files with their names in yyyymmdd.png format on a server with no ftp access (e.g. http://www.example.com/20111228.png). I would like to run a PHP/js script on my LOCAL server which would download all of the files to my local disk following few rules:

i) check if remote file already exists on local disk and if so just skip it
ii) display status on my html page in some kind of list or whatever for each file (e.g. 20111228.png - file exists or 20111228.png - file doesn't exist)
iii) when non-existing file has been processed (copied to local disk), display OK or ERROR status next to that item in generated list.

I'm not asking for complete code here... Especially because I'm sure that someone else already did that. But some guides or any url/google query would be extremely helpful :)

Thanks a lot in advance!


Solution

  • Server can't just access your hard drive. Maybe there are some java/flash proxies, i know that asus driver download works with java and shows status within it. Another option is to compress these files with zip an then download them, so your browser shows how much is left. And if you are able to pack these files with php then maybe there's a solution for "on the fly" comprssing so you can download these files as you compress them (stream)

    Found this: http://www.element-it.com/multiple-file-upload-applet/java-uploader.aspx Didn't fall into details but it said "JavaPowUpload is File Uploader and File Downloader applet" and it supported multiple file download. My google query: http://www.google.ee/search?q=download+multiple+files+with+progress+bar&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a