c# - Getting wrong file content when downloading file from server? -


i have php script on our server use download file .net/unity3d:

php script:

<?php $name_to_save = $_get["name"]; $data_to_save = $_get["data"];  $myfile = $name_to_save . ".txt"; $fh = fopen($myfile, 'w') or die("can't open file"); fwrite($fh, $data_to_save); fclose($fh); ?> 

c# upload code:

const string serversavefile = "http://website.com/webserver/save-new.txt"; const string serverphpfile = "http://website.com/webserver/save-new.php";  ienumerator anotheruploadroutine(string data) {     string url = serverphpfile + "?" + "name=" + "save-new" + "&data=" + data;      www post = new www(url);     yield return post;      if (post.error != null)         print("there error saving data: " + post.error); } 

uploading works fine.

but when try download, never downloaded values. previous uploaded values.

c# download code:

ienumerator anotherdownloadroutine() {     var www = new www(serversavefile);     yield return www;      print(www.text); } 

i access server folder via winscp (ftp protocol, port 21). that's why can see it's doing upload correctly: can see content of file.

any idea i'm missing/doing wrong?


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -