Get ready for BLACK FRIDAY shopping starting in

Forums

PHP

This topic is locked

error pure php upload

Posted 02 Dec 2003 14:03:41
1
has voted
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>&lt;?php require_once('../Connections/conDetapperij.php'); ?&gt;
&lt;?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-&gt;path = "../fotogalerij";
$ppu-&gt;extensions = "";
$ppu-&gt;formName = "uploadform";
$ppu-&gt;storeType = "path";
$ppu-&gt;sizeLimit = "";
$ppu-&gt;nameConflict = "over";
$ppu-&gt;requireUpload = "true";
$ppu-&gt;minWidth = "";
$ppu-&gt;minHeight = "";
$ppu-&gt;maxWidth = "";
$ppu-&gt;maxHeight = "";
$ppu-&gt;saveWidth = "";
$ppu-&gt;saveHeight = "";
$ppu-&gt;timeout = "5";
$ppu-&gt;progressBar = "";
$ppu-&gt;progressWidth = "300";
$ppu-&gt;progressHeight = "100";
$ppu-&gt;checkVersion("2.1.2";
$ppu-&gt;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);
?&gt;
&lt;?php require_once('../ScriptLibrary/incPureUpload.php'); ?&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Foto's uploaden&lt;/title&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;
&lt;script language='javascript' src='../ScriptLibrary/incPureUpload.js'&gt;&lt;/script&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;form action="&lt;?php echo $GP_uploadAction; ?&gt;" method="post" enctype="multipart/form-data" name="uploadform" onSubmit="checkFileUpload(this,'',true,'','','','','','','');return document.MM_returnValue"&gt;
&lt;label for="label2"&gt;&lt;/label&gt;
&lt;p&gt;
&lt;input name="foto_path" type="file" id="label2" onChange="checkOneFileUpload(this,'',true,'','','','','','','')"&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;label for="select"&gt;&lt;/label&gt;
&lt;select name="foto_folder" id="foto_folder"&gt;
&lt;option selected&gt;uw keuze&lt;/option&gt;
&lt;option value="folder1"&gt;folder1&lt;/option&gt;
&lt;option value="folder2"&gt;folder2&lt;/option&gt;
&lt;option value="folder3"&gt;folder3&lt;/option&gt;
&lt;/select&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;label for="Submit"&gt;&lt;/label&gt;
&lt;input type="submit" name="Submit" value="Submit" id="Submit"&gt;
&lt;/p&gt;

&lt;/form&gt;

&lt;/body&gt;
&lt;/html&gt;
&lt;?php
mysql_free_result($rsFotogalerij);
?&gt;</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>&lt;?php require_once('../ScriptLibrary/incPureUpload.php'); ?&gt; </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.

Reply to this topic