php - Transfer files from s3 to SFTP server -
i have logic upload images s3 in php. need upload same set of images in sftp server. in view there 2 options. first find logic upload image local server, when uploading images s3 , other option write script transfer images s3 sftp server. need same set of images in server , s3.
out of 2 approaches, 1 optimal? there other way approach requirement? sample php script available local sftp file transfer, if yes please provide code.
i cannot sure 1 optimal, can see potential issue option #1. if perform second upload (i.e. "local" server sftp server) during first upload, make php wait on operation before returning response client. cause unnecessary hanging user agent connecting local server.
i explore option #2 first. if possible, sshfs. way mount remote filesystem on ssh. uses sftp transfer files. may possible solution have write file once local server's filesystem , again mounted, remote filesystem. sshfs take care of transfer you.
Comments
Post a Comment