newbie: move_uploaded_file fails
- From: "R.A.M." <r_ahimsa_m@xxxxxxxxxxxxxx>
- Date: Fri, 28 Mar 2008 18:58:50 +0100
In the code below I cannot move uploaded file. I don't know why. The folder
Paper has priviledges rwxrwxrwx. $_POST['Year'] and $_POST['Month'] are
valid.
Please help.
Thanks in advance!
<?php
session_start();
if ($_SERVER['REQUEST_METHOD'] == 'POST' &&
isset($_POST['EditionFile']) && isset($_POST['Year']) &&
isset($_POST['Month']))
{
if (is_uploaded_file($_FILES['SelectEditionFile']['tmp_name']))
{
// Załaduj plik:
$file = $_FILES['SelectEditionFile']['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['SelectEditionFile']['tmp_name'], $paper))
// HERE PROBLEM
{
$_SESSION['Error'] = 'Cannot move uploaded file.';
}
....
.
- Follow-Ups:
- Re: newbie: move_uploaded_file fails
- From: Jerry Stuckle
- Re: newbie: move_uploaded_file fails
- From: The Natural Philosopher
- Re: newbie: move_uploaded_file fails
- Prev by Date: Re: Need help with PHP + MySQL on W2k
- Next by Date: Re: newbie: move_uploaded_file fails
- Previous by thread: PHP AND OR
- Next by thread: Re: newbie: move_uploaded_file fails
- Index(es):