Community discussions

MikroTik App
just joined
Topic Author
Posts: 24
Joined: Tue Nov 01, 2011 10:12 pm

possible to create a folder via FTP?

Thu Nov 22, 2012 3:26 pm

Is it possible to create a folder via FTP? I have Fetch working fine, but I want to organize things in a folder structure, and would like a script to handle naming the folder (and therefore creating the folder in the first place).

I get:

failure: Unrecognized FTP server response: 553 Can't open that file: No such file or directory
User avatar
Long time Member
Long time Member
Posts: 586
Joined: Wed Nov 30, 2011 3:05 am

Re: possible to create a folder via FTP?

Thu Nov 22, 2012 7:38 pm

You can create folders, but not in a script using fetch. You'll have to use 3rd party FTP software. Apparently some people had issues doing this with particular FTP software, but this is years ago: ... 77&p=55488. I tried creating and renaming folders from linux command line FTP and Windows 7 command line FTP with no problems.

Once you have the folders created, then you can transfer files to folders between routers using fetch:
/tool fetch address=x.x.x.x upload=yes user=USER mode=ftp password=PASS src-path=/folder1/file.txt dst-path=/folder2/file.txt
I don't need any karma... I have Ιησους Χριστος!
just joined
Posts: 6
Joined: Sat Dec 01, 2012 12:33 am

Re: possible to create a folder via FTP?

Sat Dec 01, 2012 1:13 am

To create a local directory, I've been using this trick for years:
/tool fetch address= src-path=someDummyFile user=admin password=xxxx \
			mode=ftp dst-path=newDirName/newFileName;
The fetch command seems to set up the credentials with ppp and then ftp creates the newDirName. Just delete the newFileName if you don't need it, or set its contents if that's what you want to do. Since I'm creating the folder on the local file system, I use the loop-back address; I have not had need to try a remote IP.

I've recently discovered a serious problem with this however:
After upgrading from v5.4 to v5.21, I found that a system reset-configuration run-after-reset script--which by necessity runs as user sys--is refused FTP admin login: If I run this from reset-config in 5.21, I get a "530 Login incorrect" error and the script aborts. But if you run the script while logged in, that shouldn't be a problem.

Who is online

Users browsing this forum: No registered users and 15 guests