1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

HTTP copy TO

Discussion in 'Support' started by nikbackm, Oct 21, 2009.

  1. nikbackm

    Joined:
    May 30, 2008
    Messages:
    194
    Likes Received:
    1
    You can copy files from an HTTP server using the HTTP support in the COPY command.

    copy http://someserver.com/file.zip

    Is it also possible to copy files TO an HTTP server (assuming you have access rights).

    I guess it's not as straightforward as copying from the server, but if the server provides an upload form for arbitrary local files would it be possible to somehow use that from the COPY command?
     
  2. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,863
    Likes Received:
    83
    Yes, TCC supports copying in both directions with HTTP and HTTPS.

    Rex Conn
    JP Software
     
  3. nikbackm

    Joined:
    May 30, 2008
    Messages:
    194
    Likes Received:
    1
    Might it perhaps be server specific then if copying TO the server works or not?

    At least with my ISP server copying from works but not to.

    (Note: I used the correct user and pwd syntax when I tested, but with colon it seems the forum software added a smiley)

    C:\temp>copy http://userpwd@aa.bb.fi.fi/niklas/putget/listor.zip
    http://userpwd@aa.bb.fi.fi/niklas/putget/listor.zip => C:\temp\listor.zip (Replace) (Y/N/A/R)? Y
    1 file copied

    C:\temp>copy listor.zip http://userpwd@aa.bb.fi/niklas/putget/test.zip
    C:\temp\listor.zip => http://userpwd@aa.bb.fi.fi/niklas/putget/test.zip (Replace) (Y/N/A/R)? Y
    TCC: (Sys) A request to send or receive data was disallowed because the socket is not connected and (when sending on
    a datagram socket using a sendto call) no address was supplied.
    "http://netdrv.netikka.fi/niklas/putget/test.zip"
    0 files copied

    I can upload files via the upload form so I do have access rights. I can also access the same directory via FTP with no problems.

    Currently I have to use HTTP as it seems the firewall rules have been changed to only allow HTTP.
     
  4. David Marcus

    Joined:
    Jun 4, 2008
    Messages:
    648
    Likes Received:
    1
    I would guess that copying to the server uses the http "put" command while the upload form uses the http "post" command. Have you tried http://jigsaw.w3.org/Winie/? Depending on your server's configuration, you might be able to turn on "put" in your .htaccess file, but most servers are probably set to disallow such changes. Of course, if you can change the Apache configuration, you can do whatever you want.
     
  5. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,863
    Likes Received:
    83
    It's definitely server (configuration) specific. I know the HTTP copy
    works; I use it in TCC every couple of days when uploading files to
    jpsoft.com.

    Rex Conn
    JP Software
     
  6. nikbackm

    Joined:
    May 30, 2008
    Messages:
    194
    Likes Received:
    1
    Thanks, I could download files with this tool, but not upload. Probably since the server expects POST and not PUT.

    I have no option to change the server configuration, it's a common ISP server and not under my control.

    Would it be possible for the COPY command to support POST in addition to PUT? (I don't know if that's technically possible or not)
     
  7. David Marcus

    Joined:
    Jun 4, 2008
    Messages:
    648
    Likes Received:
    1
    Not easily. POST merely passes stuff to a webpage (or script). The page figures out what to do with it. The initial page (the one with the HTML form) decides what names to give the various pieces of stuff. POST is more like GET than like PUT. See:

    http://www.w3.org/TR/1999/REC-html401-19991224/interact/forms.html#h-17.13.1
    http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.3
    http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.5
    http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.6
     

Share This Page