HTTP copy TO

May 30, 2008
212
1
#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?
 
May 30, 2008
212
1
#3
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://[email protected]/niklas/putget/listor.zip
http://[email protected]/niklas/putget/listor.zip => C:\temp\listor.zip (Replace) (Y/N/A/R)? Y
1 file copied

C:\temp>copy listor.zip http://[email protected]/niklas/putget/test.zip
C:\temp\listor.zip => http://[email protected]/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
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.
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.
 
May 30, 2008
212
1
#6
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.
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
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)
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