Hello,
Please help in the following problem:
I have written a PHP5 script uploading file:
if ($_SERVER['REQUEST_METHOD '] == 'POST' &&
isset($_POST['EditionFile']) && isset($_POST['Year']) &&
isset($_POST['Month']))
{
if (is_uploaded_fi le($_FILES['SelectEditionF ile']['tmp_name']))
{
// Load file:
$file = $_FILES['SelectEditionF ile']['name'];
$ext = @substr($file,
@strrpos($file, '.') ? @strrpos($file, '.') + 1 : @strlen($file),
@strlen($file)) ;
$paper = 'Paper/Blask_' . $_POST['Year'] . '-' . $_POST['Month'] . '.' .
$ext;
@unlink($paper) ;
if (!move_uploaded _file($_FILES['SelectEditionF ile']['tmp_name'], $paper))
{
$_SESSION['Error'] = 'Cannot move file.';
}
....
The problem is that 'Cannot move file' is reached during execution of the
script. I don't know why. I have checked priviledges on $paper folder: it
looks OK.
Will you help me?
/RAM/
Please help in the following problem:
I have written a PHP5 script uploading file:
if ($_SERVER['REQUEST_METHOD '] == 'POST' &&
isset($_POST['EditionFile']) && isset($_POST['Year']) &&
isset($_POST['Month']))
{
if (is_uploaded_fi le($_FILES['SelectEditionF ile']['tmp_name']))
{
// Load file:
$file = $_FILES['SelectEditionF ile']['name'];
$ext = @substr($file,
@strrpos($file, '.') ? @strrpos($file, '.') + 1 : @strlen($file),
@strlen($file)) ;
$paper = 'Paper/Blask_' . $_POST['Year'] . '-' . $_POST['Month'] . '.' .
$ext;
@unlink($paper) ;
if (!move_uploaded _file($_FILES['SelectEditionF ile']['tmp_name'], $paper))
{
$_SESSION['Error'] = 'Cannot move file.';
}
....
The problem is that 'Cannot move file' is reached during execution of the
script. I don't know why. I have checked priviledges on $paper folder: it
looks OK.
Will you help me?
/RAM/
Comment