how many instances of "a" are there in:
q: overwrite=true not allowing me to overwrite files when uploading via rest i am using the following line of code to set the upload location for my file: 
        var filecollectionendpoint = siteurl + 
"/_api/web/getfolderbyserverrelativeurl('" + serverrelativeurltofolder + 
"')/files/add(overwrite=true,url='" + filename + "')";

it works fine when uploading a document with a different name, however if i need to overwrite a document which already exists(has the same name) it throws an error saying the file already exists. major versions are turned on in my document library and versioning/overwriting is working correctly when i use the out of the box default upload form!
any ideas?

a: you could try this:


*

*check if a file with the same name exists before uploading it

*if yes, asks the user if he/she wants to overwrite the existing file

*if yes, check out the existing file

*upload your file

*(optional) check in the new uploaded file


maybe it's the checkout step that you miss here?

user
I counted forty-six "a"s in that text.
assistant