10-27-2004, 02:01 PM #1squidGuestQuestion about Uploading Images to Web
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";
// create file name
$image_file_name = $product_id.$file_extention;
if (!copy ($_FILES [small_image][tmp_name], SMALL_IMAGE.$image_file_name))
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...
Am working on v2 but need to nip this problem in the bud.
10-28-2004, 12:40 AM #2
- Member Since
- Feb 14, 2004
- Groves, Texas
- 13in macbook - 10.11 --- 21in. iMac 10.11 --- HP win 8
Dont know anything about php but is that second if statement supposed to be "image/pjpeg" ? Is that p supposed to be there?
10-29-2004, 10:58 AM #3squidGuest
yes it is that is the underlying format even though the extension is .jpg There is also just a jpeg format, but i tried that too and everything seems to work on a PC, but not on a MAC. I did have 1 customer who could upload the .gif files but not the jpg's
10-29-2004, 08:53 PM #4
Perhaps you could print out different error messages for each step so you know exactly where the problem occurs?I'm in your forums, writing sentences in a grammatically acceptable manner.
11-01-2004, 10:35 AM #5squidGuest
As I am not a Mac user, i have no way of telling what the errors are, but if someone would like to check it out for me, i will put "echo" statements in the script to show the proccess. Use the link above and i welcome all screenshots of errors, but could you please convert them to jpg format as bmp is to large to transfer.
11-02-2004, 01:10 AM #6
I meant different php echo statements for the different types of errors you get. But otherwise, no I don't know what's wrong with it. You could try posting a message to the apple web-dev mailing list: http://lists.apple.com/mailman/listinfo/web-devI'm in your forums, writing sentences in a grammatically acceptable manner.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
By melanie bund in forum Switcher HangoutReplies: 6Last Post: 01-18-2015, 05:39 PM
By DOPEkid in forum Apple NotebooksReplies: 1Last Post: 07-24-2010, 02:52 PM
By AnthonyS in forum Images, Graphic Design, and Digital PhotographyReplies: 5Last Post: 10-07-2008, 02:51 AM
By photo_guy74 in forum OS X - Apps and GamesReplies: 0Last Post: 09-03-2008, 08:57 AM
By schweb in forum Images, Graphic Design, and Digital PhotographyReplies: 2Last Post: 02-23-2006, 07:52 PM