Cli-microsoft365: New command: add file

Created on 27 Jan 2018  路  15Comments  路  Source: pnp/cli-microsoft365

Upload file to the specified folder

  • command: spo file add -w|--webUrl <webUrl> -f|--folder <folder> -p|--path <path> -c|--contentType [contentType] --checkOut --checkInComment [checkInComment] --approve --approveComment [approveComment] --publish --publishComment [publishComment] ...
  • webUrl: The URL of the site where the file should be uploaded to
  • folder: server- or site-relative URL to the folder where the file should be uploaded
  • path: local path to the file to upload
  • contentType: content type name or ID to assign to the file
  • checkOut: if versioning is enabled, this will check out the file first if it exists, upload the file, then check it in again
  • checkInComment: comment to set when checking the file in
  • approve: will automatically approve the uploaded file
  • approveComment: comment to set when approving the file
  • publish: will automatically publish the uploaded file
  • publishComment: comment to set when publishing the file
  • ...: this command should allow using unknown properties. Each property corresponds to the list item field that should be set when uploading the file. Command properties should be excluded from the SharePoint request
  • requires connection to a SharePoint site

For more information see the Add-PnPFile cmdlet

good first issue new feature work in progress

Most helpful comment

@waldekmastykarz , please assign me, I need that completed to finish a blog post of mine :)

All 15 comments

@waldekmastykarz can I pick up this one? 馃榿

Absolutely! Appreciate the help! 馃殌

Hey @rfjschouten, are you still working on it?

For now I'll assume you're not working on this one anymore and will put it back to the pool.

Hi @waldekmastykarz, sorry for the late response. I am very busy at some big projects at the moment and not in the circumstances to work on this. The command itself is pretty much there, but the tests need some more work. Maybe you can grab it from my branch? https://github.com/rfjschouten/office365-cli/tree/spo-file-add

Cool! Totally understood. I'm sure we'll be able to reuse the branch. Thanks!

Sure no problem and when I can get some more time available, I will grap up some new issues...

May I help ? Extend command to upload file with metadata, inspect metadata required, etc ?

Of course you can help! Command specs are listed above. @rfjschouten has done some work already so you could go through what he's already got and add the missing parts if necessary.

@dariuszbz , @waldekmastykarz any progress on that?

Good of you to ask @VelinGeorgiev. @dariuszbz, are you still working on this?

With the lack of response setting this item as available for picking

@waldekmastykarz , please assign me, I need that completed to finish a blog post of mine :)

Hey @VelinGeorgiev, are you still working on this?

Hi @waldekmastykarz,

I do, but even with the code from Robert I still have to do a fair bit of work.

I am working to ensure the folder tree that is specified for the folder options exists and also have to implement list item values specification.

Was this page helpful?
0 / 5 - 0 ratings