I am trying to make one sample uploader application that will sends some chunks of file data to remote server continually.
I will call one php file which will be on remote server and which will also demand for some other variables like chunkId and totalchunks.
I am using socket to do that but I can post the data to the server.
How can I send variable with socket data ?
How can I use chunk mechanism with socket ???
Pls help me....
I would actually recommend using an AMF service rather than sockects (there is Zend_AMF for PHP) to easily send your chunk data in a typed Value Object (or DTO if you prefer).
You can use the readBytes method of a ByteArray to break your file up into chunks.
Then just assign the resulting ByteArray as a property to a class that contains your other variable data. This class can then be sent over a binary AMF connect, and read in server side as a typed PHP class with the same properties and daa.
Here are some basics on using Zend_AMF: https://www.adobe.com/devnet/flex/articles/crud_flex_php_zend.html
If this isn't possible for one reason or another, you can always add some additional variables to your file chunk data before you send it over the socket, then extract them server side. Or, call a basic web service before creating the socket connection, and send all the needed variables with that call. The web service can return a token used in creating the sockect connection that ties the incoming binary data with the correct record created from the web service call.