Page 1 of 1

using JAVA FTP applet with PHP

Posted: Mon Dec 04, 2006 5:51 am
by samsonbo
Hello friends,
Now in my application the users of our website are adding the low-rez videos to the webiste, but from nowon we want to upload high-rez videos with the relevant data just like they upload images and other files. The problem is that with large video files regular http uploading may not work well. so decided to use JAVA FTP applet, which can resume uploads even after any interruptions.
can any one suggest me or help me how to code it or give any address for articles.

Thanks,
samson.

Posted: Mon Dec 04, 2006 5:57 am
by volka
An ftp server doesn't have much to do with php. Do you have a concrete concept?

Re: using JAVA FTP applet with PHP

Posted: Mon Dec 04, 2006 6:07 am
by Chris Corbyn
samsonbo wrote:Hello friends,
Now in my application the users of our website are adding the low-rez videos to the webiste, but from nowon we want to upload high-rez videos with the relevant data just like they upload images and other files. The problem is that with large video files regular http uploading may not work well. so decided to use JAVA FTP applet, which can resume uploads even after any interruptions.
can any one suggest me or help me how to code it or give any address for articles.

Thanks,
samson.
It sounds like this has little to do with PHP. It might be easier to run a servlet which has an open socket you can communicate with via the Applet.

Assuming you send the file in a streamed fashion with the applet it should be a case of:

* Open file with applet/file handling objects
* Open connection to remote socket with applet/net/io objects
* Send request to remote service with filename, filesize
* Server reports number of bytes already present if any
* Send chunks of say 8192 bytes
* Server appends bytes to existing file

Might have a shot at that myself if I get bored today :)

EDIT | I'd send a MD5 hash too and verify it once uploaded.