Zen Cart Logo
Forums / Setting Up Categories, Products, Attributes / Error on duplicate photo upload

Error on duplicate photo upload

Locked

Views: 1,018

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
31 Oct 2009, 3:48 PM
#1
docrocks avatar

docrocks

Zen Follower

Join Date:
Jun 2005
Location:
Massachusetts
Posts:
148
Plugin Contributions:
0

Error on duplicate photo upload

Running a new install of version 1.3.8 on LAMP (php 5.2.9, mysql 5.0.81community) and seeing the errors below when I try to upload a duplicate image. Permissions to the images folder are 777. Here are my error messages.

Warning: move_uploaded_file(/home/reseller/public_html/zencart/images/categories/baseballjersey1.gif) [function.move-uploaded-file]: failed to open stream: Permission denied in /home/reseller/public_html/zencart/admin/includes/classes/upload.php on line 112

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpZRfcGU' to '/home/reseller/public_html/zencart/images/categories/baseballjersey1.gif' in /home/reseller/public_html/zencart/admin/includes/classes/upload.php on line 112

Warning: Cannot modify header information - headers already sent by (output started at /home/reseller/public_html/zencart/admin/includes/classes/upload.php:112) in /home/reseller/public_html/zencart/admin/includes/functions/general.php on line 21

The error happens when I try to upload an image that has previously been uploaded. IMHO this should just give a warning that the image has already been uploaded and ask if it is the one that should be used. Hope to see this error trapped in a future release.

31 Oct 2009, 4:00 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Error on duplicate photo upload

The error is a result of how your webserver's filesystem is configured with respect to permissions, and that's outside the control of Zen Cart.

However, a quick way to suppress the "Warning" messages is to make a tiny edit as shown below. The error will be shown as a messageStack alert across the top of the page instead, simply indicating that the upload failed.

/includes/classes/upload.php
around line 136, add the @ as shown:```
if ([B]@[/B]move_uploaded_file($this->file['tmp_name'], $this->destination . $this->filename)) {