I'll try and make this quick and simple. It can be hard to search of information on something to your not 100% sure on how you would search for it.
So I have a small batch script create to execute powershell ftp access and log me in and all that fun stuff.
Basically it's a cron job to upload files to my FTP server when i need to in a heartbeat.
I have HOME server, and on a regular basis or when told to, I want my script to execute and be able to upload a directory from my HOME server to the REMOTE ftp server.
Here is the script i am using.
@echo off<br>
echo user yourusername> ftpcmd.dat<br>
echo yourpassword>> ftpcmd.dat<br>
echo bin>> ftpcmd.dat<br>
echo cd \folder>> ftpcmd.dat<br>
echo put %1>> ftpcmd.dat<br>
ftp -n -s:ftpcmd.dat yourservername<br>
so I've gathered that put %1 = filetoupload
so filename.bat (the script) filetoupload = put %1 but it gives me errors saying
Saying: so Put I:\Documents Return: Error opening local file I:\Documents
Local on the FTP server? or Local on my HOME server.
How do i make it so i can upload a chosen directory from my HOME server to the FTP REMOTE server instead of files one by one???
Thank you sincerly
I am assuming
%1
here refers to a directory to upload via FTP. You can instead use the batchfor
function/keyword to instead add manyput
directives, corresponding to files in your upload directory.For example:
and for the recursive edition: