Pure PHP Upload does not work with PHP 5
Pure PHP Upload work fine with PHP 4. But it does not upload the files with PHP 5?
Answer:
Pure PHP Upload extension use the long predefined array variables ($HTTP_*_VARS), which usually are disabled in PHP 5.
To fix the problem place the following code before those of Pure PHP Upload:
<?php
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;
}
?>
The problem also can be fixed if you enable the long predefined array variables in your php.ini file.
To do that you have set register_long_arrays variable to On in your php.ini file.
register_long_arrays = On
Enable Debug Information:
If this does not fix the problem, enable the output of debug information which could be used for resolving the issue. To enable the debug information set $DMX_debug variable to true.
$DMX_debug = true
The resulting code may look like this:
<?php
$DMX_debug = true;
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;
}
?>
<?php
// Pure PHP Upload 2.1.3
if (isset($HTTP_GET_VARS['GP_upload'])) {
Comments
Be the first to write a comment
You must me logged in to write a comment.