I've been trying to get a PHP script to SFTP upload a file, but failed. I tried asking my question on stackoverflow.com but haven't received a working solution:
So now I want to try a different approach. Is there a way to write a shell script that can issue several commands to sftp upload a file to another server? If I were to issue commands one by one from terminal, it would look like:
>sftp firstname.lastname@example.org >password: mypassword >put file.csv
I tried putting these three lines into a ./automaticupload file. When I executed the file, but the terminal shows me:
even though I typed in the password line in automaticupload.
I am unable to create a passwordless ssh/scp/sftp account. The remote server.com does not give me ssh or scp access.
What should I do?