Why do I receive the error '' Too many input arguments" ?
3 views (last 30 days)
Show older comments
I have the following code for downloading a file.
rm_dir = 'dir1/dir2/dir3/dir4/dir5/dir6';
ftpobj = ftp('host','usename','password');
cd (ftpobj,rm_dir);
mget(ftpobj,'filename.txt','parseOutput',false);
But I get an error message as follows.
Error using matlab.io.FTP/mget
Too many input arguments.
I tried using the fullpath to the file name.But still same error is encountered.
How can I solve this?
0 Comments
Answers (2)
Sulaymon Eshkabilov
on 10 Feb 2023
Have you tried this sytax:
...
mget(ftpobj,'filename.txt', 'myLocalFolder');
0 Comments
Dinesh
on 10 Feb 2023
Hi Rose Mary,
This could be due to the following two reasons.
- Version compatibility: If you're using an older version of MATLAB, the mget function syntax might have changed. You can check the documentation for the specific version of MATLAB you're using to verify the correct syntax.
- File not found: Make sure that the file filename.txt exists in the specified directory dir1/dir2/dir3/dir4/dir5/dir6. If the file is not found, you will receive an error message when trying to download it.
0 Comments
See Also
Categories
Find more on FTP File Operations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!