Jump to content

Uploading images for a product results in empty files, ver 1.3.1


Recommended Posts

Hello - I've got a fresh Prestashop 1.3.1 install and I'm attempting to upload some pictures to a product, but all of the files I upload end up being zero-length (empty), and all of the thumbnail images are also zero-length. I've enabled error reporting and checked the Apache error logs, but nothing ever shows up in there - PrestaShop only tells me that the upload was successful, when actually it wasn't.

Permissions on the directories are fine (after all, the graphic files are created, they're just zero-length). GD is installed, as a phpinfo reports:

GD Support     enabled
GD Version     bundled (2.0.34 compatible)
FreeType Support     enabled
FreeType Linkage     with freetype
FreeType Version     2.3.12
GIF Read Support     enabled
GIF Create Support     enabled
JPG Support     enabled
PNG Support     enabled
WBMP Support     enabled
XBM Support     enabled 


I've also doublechecked that PHP file uploads work in general... This little PHP script works totally fine on the server:

<?
if (array_key_exists('action', $_POST))
{   
   print '';
   print_r($_FILES);
   print '';
   move_uploaded_file($_FILES['testfile']['tmp_name'], '/path/to/img/tmp/testing.png');
}
?>
<html>
<head><title>Upload Test</title></head>
<body>

<form action="uploadtest.php" method="post" enctype="multipart/form-data">
<input type="hidden" name="action" value="upload">
Upload a file: <input type="file" name="testfile">
<input type="submit" value="Go">
</form>
</body>
</html>


Though of course I was running with the real path. I also tried into /img/p, and it worked just fine.

Anyone have any ideas?

Link to comment
Share on other sites

Update here - it turned out that the issue was a JPEG version mismatch in the GD version that was compiled into PHP. The calls to "imagecreatefromjpeg()" would never actually complete. Would be nice to have some error reporting for that; in the end I had to throw in a bunch of debugging in images.inc.php and admin/tabs/AdminProducts.php to track down where the actual problem was coming from.

Regardless, not a problem with PrestaShop itself, but the environment.

Link to comment
Share on other sites

×
×
  • Create New...