How to write/read .txt on FTP (Javascript)

Hi I want to be able to Write and Read files from my ftp server.

I have my scripts set up to do what i want but only localy.

Here is what i use:

import System;
import System.IO;

var PropertyNumber : String ="PropertyNumber"; 
var PropertyOwner : String = "Nobody";

function Update ()
{
if(File.Exists("PlayerInfo/Property"+PropertyNumber+".txt"))
{   
var si = File.OpenText("PlayerInfo/Property"+PropertyNumber+".txt");
var line = si.ReadLine();
PropertyOwner=line; } 
}

This works but i cannot just write any url in the File.OpenText("") It only works localy for now.

I just need to know how to connect to my ftp server.

I also need to be able to write txt files on my server.

Any help welcome!

Do you know anything about FtpWebRequest?

I'm not if you can write on a txt file on your ftp server directly from your application. It requires you to login first. My suggestion is to write a php cgi and place it somewhere on your webserver and then using a form in unity submit your data to that php which will then write it to a text file for you.

Here is how to write the PHP

http://www.tizag.com/phpT/filewrite.php

Here is how to create the wwwform in unity. http://unity3d.com/support/documentation/ScriptReference/WWWForm.html

hmm.. have been trying to do this for 3 hours now, somebody should make a guide for this damn.