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