I have a method that inserts a file in SharePoint using
RootFolder.Files.Add(file)
so I want to have the option to overwrite the file with only the URL.
I have a method that inserts a file in SharePoint using
RootFolder.Files.Add(file)
so I want to have the option to overwrite the file with only the URL.
The RootFolder.Files.Add
method has an overload that receives a Boolean that specifies when to overwrite files with the same name.
public SPFile Add(
string urlOfFile,
byte[] file,
bool overwrite
)
Parameters:
- urlOfFile
Type: System.String
The relative URL of the file.- file
Type: []
An array of bytes that contains the file.- overwrite
Type: System.Boolean
true
to overwrite a file with the same name;false
does not overwrite.