Hi guys,
I would appreciate very much any help that anybody can give me with the following problem I have.
I am trying to upload images using PHP move_uploaded_f ile, but for some reason the files don't get uploaded. This code has been used before and worked great, but not now. When I try to debug it shows that it reads the file name, creates the new file name and etc, but when it comes to uploading it fails. Doesn't show any error, just the variable that holds the result it's empty. Here is the code I've used:
if(!isset($_FIL ES) && isset($HTTP_POS T_FILES))
$_FILES = $HTTP_POST_FILE S;
if(!isset($_FIL ES['filProdSImg']))
$sError["filProdSIm g"] = "An image was not found.";
$sImageName = basename($_FILE S['filProdSImg']['name']);
if(empty($sImag eName))
$sError["sImageName "] = "The name of the image was not found.";
if(empty($sErro r))
{
$extension = explode ('.', $_FILES['filProdSImg']['name']);
$filename = $vcarid .'-s.'. $extension[1];
$filename = strtolower($fil ename);
$newSImage = "../products/" . $filename;
$varSImg=$newSI mage;
$sResult = @move_uploaded_ file($_FILES['filProdSImg']['tmp_name'], $newSImage);
if(empty($sResu lt))
{
$title.="";
}else{
$title.="/Thumbnail image";
}
…
…
…
More code follows to upload another image. Very similar to the above code.
I get a bit stuck at the moment as I can't see what's wrong (especially when it has worked before).
Thanks a lot
Liz
I would appreciate very much any help that anybody can give me with the following problem I have.
I am trying to upload images using PHP move_uploaded_f ile, but for some reason the files don't get uploaded. This code has been used before and worked great, but not now. When I try to debug it shows that it reads the file name, creates the new file name and etc, but when it comes to uploading it fails. Doesn't show any error, just the variable that holds the result it's empty. Here is the code I've used:
if(!isset($_FIL ES) && isset($HTTP_POS T_FILES))
$_FILES = $HTTP_POST_FILE S;
if(!isset($_FIL ES['filProdSImg']))
$sError["filProdSIm g"] = "An image was not found.";
$sImageName = basename($_FILE S['filProdSImg']['name']);
if(empty($sImag eName))
$sError["sImageName "] = "The name of the image was not found.";
if(empty($sErro r))
{
$extension = explode ('.', $_FILES['filProdSImg']['name']);
$filename = $vcarid .'-s.'. $extension[1];
$filename = strtolower($fil ename);
$newSImage = "../products/" . $filename;
$varSImg=$newSI mage;
$sResult = @move_uploaded_ file($_FILES['filProdSImg']['tmp_name'], $newSImage);
if(empty($sResu lt))
{
$title.="";
}else{
$title.="/Thumbnail image";
}
…
…
…
More code follows to upload another image. Very similar to the above code.
I get a bit stuck at the moment as I can't see what's wrong (especially when it has worked before).
Thanks a lot
Liz