<!DOCTYPE html>
<html>
<head>
<title>Hello World</title>
<style type="text/css">
</style>
</head>
<body>
  <p>
    Select a file to upload as a new Chatter File.
  </p>
  <input type="file" id="file" onchange="upload()"/>
  <p id="message"></p>
<script src="forcetk.js"></script>
<script>
  var client = new forcetk.Client();
  client.proxyUrl = null;
  
  client.setSessionToken('<%= oauth.access_token %>', 'v33.0', '<%= oauth.instance_url %>');
  function upload() {
      var file = document.getElementById("file").files[0];
      client.createBlob('ContentVersion', {
          Origin: 'H', // 'H' for Chatter File, 'C' for Content Document
          PathOnClient: file.name
      }, file.name, 'VersionData', file, function(response){
          console.log(response);
          document.getElementById("message").innerHTML = 
              "Chatter File created: <a href=\"/" + response.id + "\">Take a look!</a>";
      }, function(request, status, response){
          console.log(response);
          document.getElementById("message").innerHTML = 
              "Error: " + status;
      });
  }
</script>
</body>
</html>

<!DOCTYPE html>
<html>
<head>
<title>Hello World</title>
<style type="text/css">
</style>
</head>
<body>
  <p>
    Select a file to upload as a new Chatter File.
  </p>
  <input type="file" id="file" onchange="upload()"/>
  <p id="message"></p>
<script src="forcetk.js"></script>
<script>
  var client = new forcetk.Client();
  client.proxyUrl = null;
  
  client.setSessionToken('<%= oauth.access_token %>', 'v33.0', '<%= oauth.instance_url %>');
  function upload() {
      var file = document.getElementById("file").files[0];
      client.createBlob('ContentVersion', {
          Origin: 'H', // 'H' for Chatter File, 'C' for Content Document
          PathOnClient: file.name
      }, file.name, 'VersionData', file, function(response){
          console.log(response);
          document.getElementById("message").innerHTML = 
              "Chatter File created: <a href=\"<%= oauth.instance_url %>/" + response.id + "\">Take a look!</a>";
      }, function(request, status, response){
          console.log(response);
          document.getElementById("message").innerHTML = 
              "Error: " + status;
      });
  }
</script>
</body>
</html>

Fix link to Chatter File
Fix link to Chatter File
