marchh
Karma: 0
|
Re:Blank Page upon file aproval - 2006/12/17 23:22
nevermind
mambo's setQuery fct which replaces the dynamic prefix aliro_ caused the problem. it seems as if it couldnt handle certain chunks.
i hardcoded the prefix into the SQL query in fileToBlob()
| Code: | $sql = "INSERT INTO <strong>mos</strong>_downloads_blob (fileid, chunkid, datachunk) VALUES ('$this->
fileid', '";
|
(you could get the prefix from the mambo variable, but i didnt mind)
in the while loop i changed the call to doSQL as follows:
| Code: | remositoryRepository::doSQL($sql."$chunkid', '$chunk')", 1);
|
the 1 at the end will make the altered doSQL function skip the prefix replacement routine. Altered doSQL() function as follows:
| Code: | function doSQL ($sql, $noreplace=0) {
if ($sql) {
$interface =& remositoryInterface::getInstance();
$database =& $interface->getDB();
if ($noreplace == 0) $database->setQuery($sql);
if ($noreplace == 1) $database->setBareQuery($sql);
if (!$database->query()) {
echo "<script> alert('".$database->getErrorMsg()."'); window.history.go(-1); </script>\n";
exit();
}
}
}
|
this fixed both, approval and upload-to-db issues, since they both use fileToBlob()
|