4 * GForge Group Docman updater
6 * Copyright 2004 GForge, LLC
9 * This file is part of GForge.
11 * GForge is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * GForge is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with GForge; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US
26 require_once dirname(__FILE__).'/../www/env.inc.php';
27 require_once $gfwww.'include/pre.php';
29 $res = db_query_params ('SELECT * FROM doc_data',
38 for ($i=0; $i < db_numrows($res); $i++) {
39 $docid = db_result($res, $i, 'docid');
40 $base64_data = db_result($res, $i, 'data');
41 $data = base64_decode($base64_data);
42 $size = strlen($data);
44 $res2 = db_query_params ('UPDATE doc_data SET filesize=$1 WHERE docid=$2',
48 echo "Couldn't update document #".$docid.":".db_error()."\n";
58 // c-file-style: "bsd"