Creating Drupal nodes from Javascript (Drupal 7) We have a page inside our Drupal site that contains two canvases (one webGL).  When the user presses the save button, we create a dataURL (about 300kb) and would like to send this png to drupal (from Javascript) to create a Drupal node.  What would be the best way to accomplish this?
Here's a few things you can try. Your scenario may require customizations or other workarounds.

First, make a content type with an image field.
 Second, in hook_menu, register a path and callback and post the image with ajax. You will have to post your image data on this url.

function MODULE_menu(){
   $item['path/to/post/node/data'] = array(
       'page callback' =&gt; 'your_callback',
       'access arguments' =&gt; array('create &lt;type&gt; content'),
   );
}


Then, setup you callback as

function your_callback(){
    // Storing image data to file
    $success = file_put_contents($file_path,  base64_decode($_POST['image_data']));
    // Creating node
    if($success){
      $node = new stdClass();
      $node-&gt;type = '&lt;type&gt;';
      node_object_prepare($node);
      $node-&gt;title    = 'Node Created Programmatically on ' . date('c');
      $node-&gt;language = LANGUAGE_NONE;

      $file_realpath = drupal_realpath($file_path);
      $file = (object) array(
        'uid' =&gt; 1,
        'uri' =&gt; $file_realpath,
        'filemime' =&gt; file_get_mimetype($file_realpath),
        'status' =&gt; 1,
      );
      $file = file_copy($file, 'public://');
      // field_image is assumed as the machinename of your image field.
      $node-&gt;field_image[$node-&gt;language][0] = (array)$file;

      node_save($node);

      drupal_json_output(array('status' =&gt; 'OK', 'message' =&gt; 'New image node content is created'));
    }else{
      drupal_json_output(array('status' =&gt; 'FAILURE', 'message' =&gt; 'There is some issue in order to create new image node.'));
    }

}