Forums
This topic is locked
error pure php upload
02 Dec 2003 14:03:41 top find posted:
Everytime when i am trying to create a picture upload page i get the following error: Fatal error: Cannot instantiate non-existent class: purefileupload in /home/httpd/docs/clients/dancingdetapperij.nl/dbase/admin/testupload.php on line 24
Does anyone know what the problem is? I uploaded the
Thx a lot! Tommy
Source code of the upload page:
<b><?php require_once('../Connections/conDetapperij.php'); ?>
<?php
// *** Restrict Access To Page: Grant or deny access to this page
$FF_authorizedUsers=" ";
$FF_authFailedURL="loginfirst.php";
$FF_grantAccess=0;
session_start();
if (isset($HTTP_SESSION_VARS["MM_Username"])) {
if (true || !(isset($HTTP_SESSION_VARS["MM_UserAuthorization"])) || $HTTP_SESSION_VARS["MM_UserAuthorization"]=="" || strpos($FF_authorizedUsers, $HTTP_SESSION_VARS["MM_UserAuthorization"])) {
$FF_grantAccess = 1;
}
}
if (!$FF_grantAccess) {
$FF_qsChar = "?";
if (strpos($FF_authFailedURL, "?") $FF_qsChar = "&";
$FF_referrer = "Restricted Area";
$FF_authFailedURL = $FF_authFailedURL . $FF_qsChar . "accessdenied=" . urlencode($FF_referrer);
header("Location: $FF_authFailedURL"
exit;
}
// Pure PHP Upload 2.1.2
if (isset($HTTP_GET_VARS['GP_upload'])) {
$ppu = new pureFileUpload();
$ppu->path = "../fotogalerij";
$ppu->extensions = "";
$ppu->formName = "uploadform";
$ppu->storeType = "path";
$ppu->sizeLimit = "";
$ppu->nameConflict = "over";
$ppu->requireUpload = "true";
$ppu->minWidth = "";
$ppu->minHeight = "";
$ppu->maxWidth = "";
$ppu->maxHeight = "";
$ppu->saveWidth = "";
$ppu->saveHeight = "";
$ppu->timeout = "5";
$ppu->progressBar = "";
$ppu->progressWidth = "300";
$ppu->progressHeight = "100";
$ppu->checkVersion("2.1.2"
$ppu->doUpload();
}
$GP_uploadAction = $HTTP_SERVER_VARS['PHP_SELF'];
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
if (!eregi("GP_upload=true", $HTTP_SERVER_VARS['QUERY_STRING'])) {
$GP_uploadAction .= "?".$HTTP_SERVER_VARS['QUERY_STRING']."&GP_upload=true";
} else {
$GP_uploadAction .= "?".$HTTP_SERVER_VARS['QUERY_STRING'];
}
} else {
$GP_uploadAction .= "?"."GP_upload=true";
}
if (isset($editFormAction)) {
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
if (!eregi("GP_upload=true", $HTTP_SERVER_VARS['QUERY_STRING'])) {
$editFormAction .= "&GP_upload=true";
}
} else {
$editFormAction .= "?GP_upload=true";
}
}
mysql_select_db($database_conDetapperij, $conDetapperij);
$query_rsFotogalerij = "SELECT * FROM testupload";
$rsFotogalerij = mysql_query($query_rsFotogalerij, $conDetapperij) or die(mysql_error());
$row_rsFotogalerij = mysql_fetch_assoc($rsFotogalerij);
$totalRows_rsFotogalerij = mysql_num_rows($rsFotogalerij);
?>
<?php require_once('../ScriptLibrary/incPureUpload.php'); ?>
<html>
<head>
<title>Foto's uploaden</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language='javascript' src='../ScriptLibrary/incPureUpload.js'></script>
</head>
<body>
<form action="<?php echo $GP_uploadAction; ?>" method="post" enctype="multipart/form-data" name="uploadform" onSubmit="checkFileUpload(this,'',true,'','','','','','','');return document.MM_returnValue">
<label for="label2"></label>
<p>
<input name="foto_path" type="file" id="label2" onChange="checkOneFileUpload(this,'',true,'','','','','','','')">
</p>
<p>
<label for="select"></label>
<select name="foto_folder" id="foto_folder">
<option selected>uw keuze</option>
<option value="folder1">folder1</option>
<option value="folder2">folder2</option>
<option value="folder3">folder3</option>
</select>
</p>
<p>
<label for="Submit"></label>
<input type="submit" name="Submit" value="Submit" id="Submit">
</p>
</form>
</body>
</html>
<?php
mysql_free_result($rsFotogalerij);
?></b>
Replies
Replied 11 Dec 2007 21:56:17
11 Dec 2007 21:56:17 c l replied:
this took me about 2 hrs to solve and its all because Dreamweaver is throwing your php code out of order. See the line:
<pre id=code><font face=courier size=2 id=code><?php require_once('../ScriptLibrary/incPureUpload.php'); ?> </font id=code></pre id=code>
That needs to execute before you call it with line
<pre id=code><font face=courier size=2 id=code> $ppu = new pureFileUpload(); </font id=code></pre id=code>
Just move it to the top of the page after your other require statement and you should be fine.
<pre id=code><font face=courier size=2 id=code><?php require_once('../ScriptLibrary/incPureUpload.php'); ?> </font id=code></pre id=code>
That needs to execute before you call it with line
<pre id=code><font face=courier size=2 id=code> $ppu = new pureFileUpload(); </font id=code></pre id=code>
Just move it to the top of the page after your other require statement and you should be fine.