2

I need to attach a file to a list item in Sharepoint 2013.
If an attachment with the same name already exists, I need to overwrite its content with the new one.

I'm currently using request like this:

.../AttachmentFiles/add(FileName='MyFile.csv')

It works if no attachment with the same name exist in the item.
But it fails if attachment already exists.
Is there a way to instruct SP to overwrite the attachment when it's already exists?

2 Answers 2

2

Apparently, overwrite is not possible with REST but you can delete and re-attach it.
See this Stack Exchange post.

Sign up to request clarification or add additional context in comments.

Comments

-1

Not sure about this, but give it a try :D

.../AttachmentFiles/add(overwrite=true, FileName='MyFile.csv')

1 Comment

I've tired this, it doesn't work with attachments unfortunately.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.