0

i know with a PHP script i can upload files to a another server via FTP protocol.

But is it possible to upload a file to a another server by using the HTTP protocol?

I mean, that i change the folderpermissions to linux-"777" and my php script can upload a file directly in this folder by using username and password e.g.?

Is this possible or works this only with FTP protocol?

Max Gunter
  • 213
  • 1
  • 14
  • You can use the HTTP PUT method: http://stackoverflow.com/questions/812711/how-do-you-do-an-http-put – snibbets Nov 02 '12 at 00:02

1 Answers1

1

HTTP doesn't work that way. For uploading a file to another server using HTTP there should be a script on that server that accepts the file and puts it to a particular directory.

So from your side you need to send POST request, and on that side there should be a script that handles it.

zerkms
  • 249,484
  • 69
  • 436
  • 539
  • I was answering in general, he could extend his question, so we can raise the but's :) it's even possible to upload file via "AJAX" over http.. but yeah, a question must be more focused on a particular problem. – deb0rian Nov 01 '12 at 23:57
  • Okay, i also need a script on the other side, thats accepts my uploading file via http. – Max Gunter Nov 01 '12 at 23:57
  • @Fratyr: especially this part of the original question "my php script can upload a file directly in this folder by using username and password" prevents me from saying strict yes :-) Because sender doesn't have ability to control where the file will be uploaded (in a contrast with FTP, where it's possible) – zerkms Nov 01 '12 at 23:58