Re: newbie: move_uploaded_file fails
- From: Jerry Stuckle <jstucklex@xxxxxxxxxxxxx>
- Date: Fri, 28 Mar 2008 13:47:31 -0500
R.A.M. wrote:
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.'; }
...
Enable all errors and display them. In your php.ini file:
error_reporting=E_ALL
display_errors=on
(Which should be on for any development system).
What message do you get?
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================
.
- References:
- newbie: move_uploaded_file fails
- From: R.A.M.
- newbie: move_uploaded_file fails
- Prev by Date: Re: using a pattern to fill a rectangle
- Next by Date: Re: Php 5 and DST - touch not working
- Previous by thread: Re: newbie: move_uploaded_file fails
- Index(es):