New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
Web Design and Hosting Creating sites, scripting, and hosting discussions.

Question about Uploading Images to Web


Post Reply New Thread Subscribe

 
Thread Tools
squid
Guest
 
Posts: n/a

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
QUOTE Thanks
cradom

 
cradom's Avatar
 
Member Since: Feb 14, 2004
Location: Nederland, Texas
Posts: 3,072
cradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant future
Mac Specs: 21in iMac core2 Duo- 13in macbook - 10.9 on both

cradom is offline
Dont know anything about php but is that second if statement supposed to be "image/pjpeg" ? Is that p supposed to be there?
QUOTE Thanks
squid
Guest
 
Posts: n/a

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
QUOTE Thanks
muso

 
muso's Avatar
 
Member Since: Jan 15, 2003
Location: Whangarei, New Zealand
Posts: 2
muso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond repute
Mac Specs: Pwnt

muso is offline
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.
QUOTE Thanks
squid
Guest
 
Posts: n/a

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.
QUOTE Thanks
muso

 
muso's Avatar
 
Member Since: Jan 15, 2003
Location: Whangarei, New Zealand
Posts: 2
muso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond repute
Mac Specs: Pwnt

muso is offline
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.
QUOTE Thanks

Post Reply New Thread Subscribe


« Authoring software choice | Dream Weaver MX »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Question about printing web pages CaptainStandish Switcher Hangout 6 10-05-2004 07:43 PM
Very simple web question ApplejustWorks Web Design and Hosting 3 09-26-2004 09:46 PM
Web Sharing issues dpalxrc OS X - Operating System 0 08-31-2004 05:26 PM
Getting images to show up in Dreamweaver dziner Web Design and Hosting 4 07-22-2004 04:11 PM
Uploading pics to web shortbutkute Web Design and Hosting 3 02-15-2004 12:10 AM

All times are GMT -4. The time now is 05:50 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?