I would like to use this extension to generate URLs to insert in my WordPress site to be able to link to PDF files uploaded with WinSCP. (I used to upload with a plugin which also gave me the HTTP URLs but my site host is now preventing its use.)
No matter what I put into the
Web root path in the Configuration panel I always get the result
Command failed with return code 1
Error: ** The path /wp-content/uploads/folder/subfolder/filename.pdf is not under web root http://sitename/. **
I've tried all combinations of putting in and leaving out the
http://
and adding and leaving out
/public_html
but it makes no difference to the end result, which is always as above.
I saw that a previous poster who was having difficulty with this was advised to use
Ctrl+Shift
while clicking on
Generate HTTP URL to copy the command to the clipboard, and I give the result here for one attempt if it helps:
powershell.exe -ExecutionPolicy Bypass -STA -NoProfile -File "C:\Program Files (x86)\WinSCP\Extensions\GenerateHttpUrl.WinSCPextension.ps1" -webRoot "http://sitename" -rootPath "" -hostName "" -serverName "92.204.68.69" -path "/wp-content/uploads/foldername/subfoldername/" -pause -clipboard "filename.pdf"
Generating the URL with path is no problem and gives:
/wp-content/uploads/foldername/subfoldername/filename.pdf
I privately attach the Log file from this morning's attempts.
I hope someone can help.
Bill
WinSCP 6.3.4, build 14955 2024-06-17 under Windows 11