Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds command listitem attachment add #5345

Closed

Conversation

MathijsVerbeeck
Copy link
Contributor

Closes #5219

@milanholemans
Copy link
Contributor

Thank you @MathijsVerbeeck we'll try to review it ASAP!

Copy link
Contributor

@Jwaegebaert Jwaegebaert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @MathijsVerbeeck, would you mind updating your PR to utilize ESM? Here's a breakdown of the new changes:

@Jwaegebaert Jwaegebaert marked this pull request as draft September 3, 2023 16:27
@Jwaegebaert Jwaegebaert self-assigned this Sep 3, 2023
@MathijsVerbeeck MathijsVerbeeck force-pushed the spo-listitem-attachment-add branch from 64c6135 to 94d3d7f Compare September 4, 2023 08:55
@MathijsVerbeeck MathijsVerbeeck force-pushed the spo-listitem-attachment-add branch from dfbe2f0 to aeb0240 Compare September 4, 2023 09:02
@MathijsVerbeeck MathijsVerbeeck marked this pull request as ready for review September 4, 2023 09:07
Copy link
Contributor

@Jwaegebaert Jwaegebaert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work @MathijsVerbeeck, I've left a few suggestions you can take a look at.

I've also noticed a bit of a vague error. When you want to upload a file with a name that already exists you get this error:

Error: The specified name is already in use.

The document or folder name was not changed.  To change the name to a different value, close this dialog and edit the properties of the document or folder.

Could we modify this so the message is clearer and doesn't return any steps that aren't relevant to CLI usage?

@Jwaegebaert Jwaegebaert marked this pull request as draft September 8, 2023 15:01
@MathijsVerbeeck MathijsVerbeeck marked this pull request as ready for review September 18, 2023 10:38
Copy link
Contributor

@Jwaegebaert Jwaegebaert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Splendid work @MathijsVerbeeck! Noticed a small detail in the examples but resolved that one myself during the merging.

Add a new attachment to a list item from a local file by using list URL with a different filename

```sh
m365 spo listitem attachment add --webUrl https://contoso.sharepoint.com/sites/project-x --listUrl "/sites/project-x/Lists/DemoList" --listItemId 147 --filePath "C:/Reports/File1.jpg" --fileName "File2.jpg"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For fileName, we don't need to define the extension as this is done in code.

Suggested change
m365 spo listitem attachment add --webUrl https://contoso.sharepoint.com/sites/project-x --listUrl "/sites/project-x/Lists/DemoList" --listItemId 147 --filePath "C:/Reports/File1.jpg" --fileName "File2.jpg"
m365 spo listitem attachment add --webUrl https://contoso.sharepoint.com/sites/project-x --listUrl "/sites/project-x/Lists/DemoList" --listItemId 147 --filePath "C:/Reports/File1.jpg" --fileName "File2"

@MathijsVerbeeck MathijsVerbeeck deleted the spo-listitem-attachment-add branch May 25, 2024 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New command: spo listitem attachment add
3 participants