Developer forum

Forum » Dynamicweb 10 » Upload file with CLI

Upload file with CLI

Anders Ebdrup
Reply

Hello,

 

I am trying to upload a file with the CLI to have the site recycled after installing addins, but I can't get this to work:

 

dw files -i recycle.txt System/CloudHosting --host site.dw10.dynamicweb-cms.com --apiKey Azure.4bb9d02d4c5fsdfsdfsfsd2962a6f808f5f4c54b6e49d5a9a98fb57663d8f445af14096a19f3985c84c5321

 

Any idea what I am doing wrong here?

 

Best regards, Anders


Replies

 
Jeppe Eriksson Agger Dynamicweb Employee
Jeppe Eriksson Agger
Reply

Hi Anders,

The command appears to be correct, so can you specify what doesn't work? Are you getting an error, or does the solution simply not recycle once the file is uploaded?

- Jeppe

 
Anders Ebdrup
Reply

Hi Jeppe,

 

The only problem seems to be that the file is not uploaded :-) I have also tried with a file called anders.txt, but no file is located in the folder after the command.

 

Best regards, Anders

 
Anders Ebdrup
Reply

Hi again,

 

I seems like I was not persistent enough as it is now working.

 

Best regards, Anders

 
Kevin Steffer
Kevin Steffer
Reply

Maybe you have to put content in the file. 
the backend doesnt accept uploading empty files. 

 
Anders Ebdrup
Reply

Hi Kevin,
 

Thanks for the follow up. I realized two things to make it work; 

  1. The folder should start with a /
  2. And when I use powershell the folder was to be in quotes, so this part: System/CloudHosting has to be "/System/CloudHosting".

Best regards, Anders

 
Kevin Steffer
Kevin Steffer
Reply

We deploy files without a starting slash e.g.:

dw file -i ''D:\a\r1\a\_Build\Icons'' ''Icons'' --recursive true --overwrite true

Which means the starting slash on the remote folder isn't required, but yes we use quotes and because we have powershell variables for the folders we use double single quotes.

 
Anders Ebdrup
Reply

In my tests I can conclude, that you will need the starting slash when you are uploading a single file with "-i" command. At least I am not able to make it work without :-)

 
Kevin Steffer
Kevin Steffer
Reply

Could it be because you don't have a absolute path to your local file?

recycle.txt vs C:\temp\recycle.txt

Just weird, because it works for me :D

 

You must be logged in to post in the forum