admin管理员组文章数量:1289858
I'm trying to import a JPG to my uploads folder using WP-CLI (macOS). I'm connected to the server, I can update and activate plugins, successfully navigate to all folders, etc.
However, when I run:
wp media import /Users/d.j./Desktop/cat.jpg
I get an error:
Warning: Unable to import file '/Users/d.j./Desktop/cat.jpg'. Reason: File doesn't exist.
Error: No items imported.
The file does exist, it's right on my desktop.
Any ideas as to why I would get this error?
edit: I should add that it works fine when I use my local server.
I'm trying to import a JPG to my uploads folder using WP-CLI (macOS). I'm connected to the server, I can update and activate plugins, successfully navigate to all folders, etc.
However, when I run:
wp media import /Users/d.j./Desktop/cat.jpg
I get an error:
Warning: Unable to import file '/Users/d.j./Desktop/cat.jpg'. Reason: File doesn't exist.
Error: No items imported.
The file does exist, it's right on my desktop.
Any ideas as to why I would get this error?
edit: I should add that it works fine when I use my local server.
Share Improve this question edited Jul 13, 2021 at 20:09 itsjustdj asked Jul 11, 2021 at 19:01 itsjustdjitsjustdj 114 bronze badges 2 |1 Answer
Reset to default 1I figured it out, with some help. You have to be on the same server where the files are located to use wp media import. The steps are:
- Log out of ssh connection
- Log into the remote server using sftp
- Upload the files using sftp, then log out
- Log back in using ssh
- Then you can use
wp media import
Essentially, ssh is for commands and sftp is for file transfers.
I hope this helps someone else with this issue.
本文标签: wp cliWPCLI media import error
版权声明:本文标题:wp cli - WP-CLI media import error 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741444301a2379102.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
~
at the start of your path to find the right directory. – vancoder Commented Jul 12, 2021 at 19:00