This question already has an answer here:
I have a script that creates an eBay template via PHP script. It has a function where it uploads the image file to the respective domain via an image_copy.php script on the domain. Anyway, not sure if that matters. But after moving the site over to a server running PHP 5.3 the script stopped working and I started getting an error:
Warning: copy(temp/0) [function.copy]: failed to open stream: Permission denied in /home/drcom/public_html/v2/techrange/ebay_template_create.php on line 58
Warning: copy(temp/1) [function.copy]: failed to open stream: Permission denied in /home/drcom/public_html/v2/techrange/ebay_template_create.php on line 58
The code and copy function in question is:
$imgs = split(",", $_SESSION["ebay_template_img"], 6);
if (!empty($imgs)) {
foreach ($imgs as $key => $img) {
if (!empty($img)) {
if (copy("http://www." . $_SESSION["ebay_template_website"] . ".com/drcom/ebay/image.php?img_source_url=" . $img, "temp/" . $key)) {
$img_files[$key + 1] = $img;
}
}
}
}
}
Not sure what is going on, and why the copy function is failing. Hope I can get this cleared out, as now I can't run the eBay store efficiently without these images uploading and working! =/
</div>
Looks like I had to delete the previous image files in the temp folder and now that portion of the script is working fine. Not sure why, but the user permissions looked OKAY.