Replace the filepath extension as required