Results 1 to 6 of 6
  1. #1
    squid
    Guest
    Question Question 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";
    }
    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

  2. #2
    Question about Uploading Images to Web
    cradom's Avatar
    Member Since
    Feb 14, 2004
    Location
    Nederland, Texas
    Posts
    4,074
    Specs:
    13in macbook - 10.10.4
    Dont know anything about php but is that second if statement supposed to be "image/pjpeg" ? Is that p supposed to be there?

  3. #3
    squid
    Guest
    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

  4. #4
    Question about Uploading Images to Web
    muso's Avatar
    Member Since
    Jan 15, 2003
    Location
    Whangarei, New Zealand
    Posts
    2
    Specs:
    Pwnt
    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.

  5. #5
    squid
    Guest
    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.

  6. #6
    Question about Uploading Images to Web
    muso's Avatar
    Member Since
    Jan 15, 2003
    Location
    Whangarei, New Zealand
    Posts
    2
    Specs:
    Pwnt
    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-dev
    I'm in your forums, writing sentences in a grammatically acceptable manner.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. images not uploading to site in safari browser
    By melanie bund in forum Switcher Hangout
    Replies: 6
    Last Post: 01-18-2015, 04:39 PM
  2. Images Getting Cut Off While Uploading And Viewing
    By DOPEkid in forum Apple Notebooks
    Replies: 1
    Last Post: 07-24-2010, 01:52 PM
  3. Uploading Images onto an iPhone
    By AnthonyS in forum Images, Graphic Design, and Digital Photography
    Replies: 5
    Last Post: 10-07-2008, 01:51 AM
  4. Question about uploading a slideshow to the web
    By photo_guy74 in forum OS X - Apps and Games
    Replies: 0
    Last Post: 09-03-2008, 07:57 AM
  5. Trouble Uploading Images?
    By schweb in forum Images, Graphic Design, and Digital Photography
    Replies: 2
    Last Post: 02-23-2006, 06:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •