using File.Copy to copy files to shared hosting site

Discussion in 'ASP .Net' started by Steve Richter, Apr 18, 2005.

  1. can File.Copy be use to copy files from my PC to the file system at my
    shared hosting web site? If so, what is the format of the path name of
    the file on the web site?

    The idea being that if I login to my ftp site, any subsequent File.Copy
    commands will not require server authentication.

    this fails - invalid string format:
    string source = "c:\\src#\\appl\\bin\\Debug\\orders.dll" ;
    string dest = "ftp:///WineStore/orders.dll" ;
    System.IO.File.Copy( source, dest, true ) ;

    this did not work either:
    string source = "c:\\src#\\appl\\bin\\Debug\\orders.dll" ;
    string dest = "//www.domain.com/WineStore/orders.dll" ;
    System.IO.File.Copy( source, dest, true ) ;

    thanks,
    -Steve
     
    Steve Richter, Apr 18, 2005
    #1
    1. Advertising

  2. > string dest = "ftp:///WineStore/orders.dll" ;

    What happens when you put this string in the address bar of Windows
    Explorer?

    Explorer uses the same mechanism to connect to the site, so you should make
    sure this works first.

    By the way, you can use a password like this:
    ftp:://user:p

    Greetings,
    Wessel
     
    Wessel Troost, Apr 18, 2005
    #2
    1. Advertising

  3. Wessel Troost wrote:
    > > string dest = "ftp:///WineStore/orders.dll" ;

    >
    > What happens when you put this string in the address bar of Windows
    > Explorer?


    it works. only I have to leave off the file name at the end:
    ftp://username:/WineStore/bin

    IE does not like the back slash in the address bar however. Only
    forward slash works for me.

    > Explorer uses the same mechanism to connect to the site, so you

    should make
    > sure this works first.
    >
    > By the way, you can use a password like this:
    > ftp:://user:p


    this works, so I am sure the format of the from path is ok.
    string source, dest ;
    source = "c:\\src#\\abc\\bin\\Debug\\orders.dll" ;
    dest = "c:\\src#\\abc\\bin\\Debug\\orders.dll" ;
    System.IO.File.Copy( source, dest, true ) ;

    this does not:
    source = "c:\\src#\\abc\\bin\\Debug\\orders.dll" ;
    dest = "ftp://username:p/WineStore/bin/orders.dll"
    ;
    System.IO.File.Copy( source, dest, true ) ;

    here is the error:
    System.NotSupportedException occured in mscorlib.dll
    additional information: the given path's format is not supported

    thanks for the help,
    -Steve


    >
    > Greetings,
    > Wessel
     
    Steve Richter, Apr 18, 2005
    #3
  4. > the given path's format is not supported
    >

    Maybe it's telling you that the "FTP://" style URL is not supported in
    ..NET. At any rate, I found a KB article that explains FTP under .NET.
    Perhaps it is of use to you, it certainly contains an alternative way of
    transferring the file:

    http://support.microsoft.com/?scid=kb;EN-US;832679

    It does seem awfully complex.

    Greetings,
    Wessel
     
    Wessel Troost, Apr 18, 2005
    #4
  5. Wessel Troost wrote:
    > > the given path's format is not supported
    > >

    > Maybe it's telling you that the "FTP://" style URL is not supported

    in
    > .NET. At any rate, I found a KB article that explains FTP under

    ..NET.
    > Perhaps it is of use to you, it certainly contains an alternative way

    of
    > transferring the file:
    >
    > http://support.microsoft.com/?scid=kb;EN-US;832679


    wow! a full ftp socket program written in vb.net.

    thanks for the help

    -Steve

    >
    > It does seem awfully complex.
    >
    > Greetings,
    > Wessel
     
    Steve Richter, Apr 18, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Coder

    Upload Files to Hosting Site

    Coder, May 22, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    334
    Mark Rae
    May 22, 2006
  2. Replies:
    4
    Views:
    20,864
    Nicole Calinoiu
    May 31, 2006
  3. Douglass Turner
    Replies:
    2
    Views:
    2,080
    Manfred Bartz
    Sep 4, 2003
  4. JEFF
    Replies:
    2
    Views:
    221
    brians[MCSD]
    Nov 12, 2007
  5. teo1991
    Replies:
    0
    Views:
    649
    teo1991
    Apr 2, 2009
Loading...

Share This Page