S
squid
Guest
We have written a shopping cart script in php and have had major success with it, save one thing. Our Mac users have been unable to upload images to web servers, PCs are fine, and i cant figure out whats wrong. We have tried several different browsers for the mac and several different image types. Below is the code that is used to upload the images.
$date = date ("y-m-d-H:i:s");
$hash = md5 ($date);
$product_id = substr ($hash, 0, 6);
if ($_FILES [small_image][size] > 0)
{
if ($_FILES [small_image][type] == "image/pjpeg")
{
$file_extention = ".jpg";
}
elseif ($_FILES [small_image][type] == "image/gif")
{
$file_extention = ".gif";
}
else
{
$error++;
}
// create file name
$image_file_name = $product_id.$file_extention;
if (!copy ($_FILES [small_image][tmp_name], SMALL_IMAGE.$image_file_name))
{
$error++;
}
}
Just wondering if anyone had any clue at all as to why this will not work on a mac. If any would like to test it out I have set up a test site...
http://gs2.lacefarms.com/admin/?page=add_products
Am working on v2 but need to nip this problem in the bud.
TIA
Squid
$date = date ("y-m-d-H:i:s");
$hash = md5 ($date);
$product_id = substr ($hash, 0, 6);
if ($_FILES [small_image][size] > 0)
{
if ($_FILES [small_image][type] == "image/pjpeg")
{
$file_extention = ".jpg";
}
elseif ($_FILES [small_image][type] == "image/gif")
{
$file_extention = ".gif";
}
else
{
$error++;
}
// create file name
$image_file_name = $product_id.$file_extention;
if (!copy ($_FILES [small_image][tmp_name], SMALL_IMAGE.$image_file_name))
{
$error++;
}
}
Just wondering if anyone had any clue at all as to why this will not work on a mac. If any would like to test it out I have set up a test site...
http://gs2.lacefarms.com/admin/?page=add_products
Am working on v2 but need to nip this problem in the bud.
TIA
Squid