This project has moved. For the latest updates, please go here.

How to change a file type in a SharePoint document library using SPServices

Feb 17, 2016 at 3:05 PM
All I want to do is change a file's extension in a document list from, say fred.txt to fred.log. Should be simple, no?

We have a document library into which files are emailed. However they are .eml files and I need to rename them as .mht files.

It's easy to change the file name using updateListItems and the following XML:
<Batch OnError="Continue" PreCalc="TRUE" ListVersion="0">
 <Method ID="01" Cmd="Update">
  <Field Name="ID">2794</Field>
  <Field Name="FileRef">http://wss/sites/Intnts/Media Coverage - 10 Feb 2016.eml</Field>
  <Field Name="BaseName">Media Coverage - 10 Feb 2016.mht</Field>
...but it results in the file changing from Media Coverage - 10 Feb 2016.eml to Media Coverage - 10 Feb 2016.mht.eml

I've spent ages trying to find out how to just change the file extension and failed :(

Can someone point me towards the (no doubt obvious) answer?

Many thanks.