Re: Image Uploader

From: Date: Wed, 23 Jun 2004 00:27:23 +0000
Subject: Re: Image Uploader
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-188838@lists.php.net to get a copy of this message
Sean Vasey wrote --- napísal::
// variables $imagesize = getimagesize($image);
// some code removed
if ($img[$i] == "$gif") // if gif file type { $image[$i] = $image[$i] . "-" . "$rand" . ".gif"; }
So is $image a filename or an array?
// begin checks and upload if successful if ($_REQUEST['submitted']) // if hidden field, submitted, is obtained on request, begin processing
{
Are register_globals on or off?
@copy($image[$i], "$uploadpath/$image[$i]") or $result .= "$image[$i] could not be copied to the server. Please try again!";
Always use move_uploaded_file() instead of copy(). copy() will not work if safe mode is on. And remove @ while debugging.
if (file_exists("$uploadpath/$image[$i]"))
Do you really want to save the file with the assigned random name? Please, read http://sk2.php.net/manual/en/features.file-upload.php

« previous php.general (#188838) next »