Pure PHP Upload 2 Support Product Page

Just installed PurePHP and cannot upload files!

Reported 21 Dec 2006 03:26:55
1
has this problem
21 Dec 2006 03:26:55 John Wogick posted:
I just purchased PurePHP Upload and addon pack and created a simple page with file field and when I click submit not only does the file not upload but it does not go to the page I have selected either.

Here is the code that Dreamweaver Creates:
<pre id=code><font face=courier size=2 id=code>
&lt;?php require_once('ScriptLibrary/incPureUpload.php'); ?&gt;
&lt;?php
// Pure PHP Upload 2.1.3
if (isset($HTTP_GET_VARS['GP_upload'])) {
$ppu = new pureFileUpload();
$ppu-&gt;path = "images";
$ppu-&gt;extensions = "";
$ppu-&gt;formName = "form1";
$ppu-&gt;storeType = "path";
$ppu-&gt;sizeLimit = "";
$ppu-&gt;nameConflict = "error";
$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 = "600";
$ppu-&gt;progressBar = "";
$ppu-&gt;progressWidth = "300";
$ppu-&gt;progressHeight = "100";
$ppu-&gt;checkVersion("2.1.3";
$ppu-&gt;doUpload();

$uploadGoTo = "drivers/index.htm";
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
$uploadGoTo .= (strpos($uploadGoTo, '?')) ? "&" : "?";
$uploadGoTo .= $HTTP_SERVER_VARS['QUERY_STRING'];
}
header(sprintf("Location: %s", $uploadGoTo));
}
$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";
}
}
?&gt;&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /&gt;
&lt;title&gt;Untitled Document&lt;/title&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="form1" id="form1" onsubmit="checkFileUpload(this,'',true,'','','','','','','');return document.MM_returnValue"&gt;
&lt;p align="center"&gt;
&lt;input name="file" type="file" onchange="checkOneFileUpload(this,'',true,'','','','','','','')" /&gt;
&lt;/p&gt;
&lt;p align="center"&gt;
&lt;input type="submit" name="Submit" value="Submit" /&gt;
&lt;/p&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</font id=code></pre id=code>

I have set the proper permissions on the upload folder and the returned url is:

www.mckeancountyraceway.com/upload.php?GP_upload=true

So the result is true but no file upload and the page that it should direct to is:

drivers/profile.php

Any ideas on this matter would be greatly appreciated.

Replies

Replied 30 Jan 2007 18:10:08
30 Jan 2007 18:10:08 Georgi Kralev replied:
Hi John,

Try to add the following lines before the line Pure PHP Upload 2.1.3

<pre id=code><font face=courier size=2 id=code>if( !isset( $HTTP_SERVER_VARS ) )
{
$HTTP_SERVER_VARS = $_SERVER;
}
if( !isset( $HTTP_GET_VARS ) )
{
$HTTP_GET_VARS = $_GET;
}
if( !isset( $HTTP_POST_VARS ) )
{
$HTTP_POST_VARS = $_POST;
}
if( !isset( $HTTP_POST_FILES ) )
{
$HTTP_POST_FILES = $_FILES;
} </font id=code></pre id=code>

I hope it will help you.

Regards,


Georgi Kralev

----------------------------------
Support - www.DMXzone.com
Replied 18 Feb 2007 12:26:22
18 Feb 2007 12:26:22 Dave Buchholz replied:
George,

Is this problem related to PHP 5.2.0 as I have only encountered this since moving to the latest version of PHP
Replied 19 Feb 2007 11:41:33
19 Feb 2007 11:41:33 Georgi Kralev replied:
Hi Dave,

Indeed, this is PHP 5.
Do you experience the problem if you paste the following lines in your php page?

<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
if( !isset( $HTTP_SERVER_VARS ) )
{
$HTTP_SERVER_VARS = $_SERVER;
}
if( !isset( $HTTP_GET_VARS ) )
{
$HTTP_GET_VARS = $_GET;
}
if( !isset( $HTTP_POST_VARS ) )
{
$HTTP_POST_VARS = $_POST;
}
if( !isset( $HTTP_POST_FILES ) )
{
$HTTP_POST_FILES = $_FILES;
}
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Note: They should be paste before the code the Pure PHP upload code.

Regards,

Georgi Kralev

----------------------------------
Support - www.DMXzone.com
Replied 23 Feb 2007 16:29:38
23 Feb 2007 16:29:38 Dave Buchholz replied:
George,

The code you pasted solves the problem for me and I am able to upload with PHP 5.2.0
Replied 23 Feb 2007 16:53:40
23 Feb 2007 16:53:40 Georgi Kralev replied:
Dave,

Thank you for your response. We will fix the extension for its next update (So, your will not have to put the code manually).

If you have any other questions or problem do not hesitate to contact us.

Regards,

Georgi Kralev

----------------------------------
Support - www.DMXzone.com
Replied 08 Oct 2010 20:26:19
08 Oct 2010 20:26:19 Dan Everton replied:
QuoteDave,

Thank you for your response. We will fix the extension for its next update (So, your will not have to put the code manually).

George - I am having problems with this now in 2010 - have you released an update as this is driving me crazy and my client is demanding the image upload function to work ok

Please help
Dan

Reply to this topic