title: How do i upload a file to my ftp at weebly.com?
body: <p>This is what they say about using the ftp:</p>
  
  <pre><code>http://www.ipage.com/controlpanel/FTP.bml
  </code></pre>
  
  <p>You can build your site using Web authoring tools, and then use an FTP program to upload the Web pages to your iPage account.</p>
  
  <p>To access your account using an FTP client, you need to connect to ftp.newsxpressmedia.com with your FTP username and password.</p>
  
  <p>This is the method i'm trying now:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using System.IO;
  using System.Net;
  
  namespace ScrollLabelTest
  {
      class FtpFileUploader
      {
          static string ftpurl = "ftp://ftp.newsxpressmedia.com";
          static string filename = @"c:\temp\test.txt";
          static string ftpusername = "newsxpressmediacom";
          static string ftppassword = "*****";
          static string value;
  
          public static void test()
          {
              try
              {
                  // Get the object used to communicate with the server.
                  FtpWebRequest request = (FtpWebRequest)WebRequest.Create(ftpurl);
                  request.Method = WebRequestMethods.Ftp.UploadFile;
  
                  // This example assumes the FTP site uses anonymous logon.
                  request.Credentials = new NetworkCredential(ftpusername, ftppassword);
  
                  // Copy the contents of the file to the request stream.
                  StreamReader sourceStream = new StreamReader(@"c:\temp\test.txt");
                  byte[] fileContents = Encoding.UTF8.GetBytes(sourceStream.ReadToEnd());
                  sourceStream.Close();
                  request.ContentLength = fileContents.Length;
  
                  Stream requestStream = request.GetRequestStream();
                  requestStream.Write(fileContents, 0, fileContents.Length);
                  requestStream.Close();
  
                  FtpWebResponse response = (FtpWebResponse)request.GetResponse();
  
                  Console.WriteLine("Upload File Complete, status {0}", response.StatusDescription);
  
                  response.Close();
              }
              catch(Exception err)
              {
                  string t = err.ToString();
              }
          }
      }
  }
  </code></pre>
  
  <p>But i'm getting exception on the line:</p>
  
  <pre><code>Stream requestStream = request.GetRequestStream();
  </code></pre>
  
  <p>The exception:</p>
  
  <pre><code>The requested URI is invalid for this FTP command
  </code></pre>
  
  <p>The complete exception error message:</p>
  
  <pre><code>System.Net.WebException was caught
    HResult=-2146233079
    Message=The requested URI is invalid for this FTP command.
    Source=System
    StackTrace:
         at System.Net.FtpWebRequest.GetRequestStream()
         at ScrollLabelTest.FtpFileUploader.test() in e:\test\test\test\FtpFileUploader.cs:line 36
    InnerException: 
  </code></pre>
  
  <p>Line 36 is:</p>
  
  <pre><code>Stream requestStream = request.GetRequestStream();
  </code></pre>