document.write("
$filename = "myFile.txt"; $data = "This data gets inserted in to the file"; $postbody = array( 'name' => $filename, 'data' => $data, 'uploadType' => "text/plain" ); $gsso = new Google_Service_Storage_StorageObject(); $gsso->setName( $filename ); $result = $storage->objects->insert("BUCKET_NAME", $gsso, $postbody );