0

I'm trying to transfer a file from a windows computer to a LAMP server. My plan was originally to write a php script that would accept the location of the file, and then copy it into a preexisting folder on the server. Is there an easy way to do this? I am fairly new to php, so any help would be appreciated. I did download cygwin, I thought it might be needed to transfer from the windows to the linex computers.

Thanks.

user3175137
  • 97
  • 1
  • 9

1 Answers1

0

In this case, PHP is just going to add an extra layer of complexity to your task, assuming that there is not some other reason you want to do this via PHP.

A Windows tool like PuTTY can allow you to access and copy files to the Linux machine via SCP or SFTP.

If you want to make accessing your Linux machine's files easy from any Windows machine on your network, use SAMBA and then transferring is just a matter of connecting via "network neighborhood".

http://ubuntuforums.org/showthread.php?t=202605

Digital Chris
  • 6,177
  • 1
  • 20
  • 29
  • The reason I wanted to use PHP was because I wanted a script that I could call (probably in a c++ app I'm designing) that would automatically pull the file to the server. I know I can transfer a file manually using PuTTY, but is there a way I can transfer with a script? – user3175137 Feb 12 '14 at 19:58
  • You can do that right in c++ http://stackoverflow.com/questions/2452457/network-file-transfer-in-windows, assuming the user running the c++ program has write access to the destination. – Digital Chris Feb 12 '14 at 20:03
  • Ah, great. It looks like what I'm looking for is the `TransmitFile` function. I've never opened and closed sockets before, so I'll look into doing that. I assume that it's possible to open a socket to the location I'm trying to copy to, then just run `TransmitFile` to send my selected file to the location? – user3175137 Feb 12 '14 at 20:24