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

Error on duplicate photo upload

Locked

Started by docrocks on 31 Oct 2009, 3:48 PM · 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.

DocRocks
My goal is to consume the Web, one byte at a time.

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

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
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)) {

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.