Reputation: 560
I want to send files data from Java to PHP and then the php saves the data to a file . here's my code : the java code :
byte[] data=...
str = new String(data,"ISO-8859-1"); //convert data to String .
// send(str);
and here's the php script:
$data = // get the data from java .
fwrite($fr1,$data);
the problem is that this script work only with text files and not for image files and Zip files . how can I solve that ?
Upvotes: 0
Views: 255
Reputation: 59
Can you please make it clear?..do you want to read the image or zip file...or want to send them.
in my opinion, Send the path of the image and zip file which you to be read in PHP that would be better approach. There won't be any chance of degrading the quality of the image or problem in extracting the zip file etc.
Below links may help you:
http://blog.joa-ebert.com/2006/05/01/save-bytearray-to-file-with-php/
Saving a bytearray with php received from Flex Air app
Upvotes: 1