rialni Posted February 14, 2014 Share Posted February 14, 2014 Hi, I recently moved a shop from a .nu domain to a .dk domain. All was successful, but now we find out that the PDF attachement (with product information - for download at specific product site) cannot be opened. Error message is 'PDF document could not be read'. Does anyone have an idea of what could have gone wrong? What can I do to fix this issue? domain is phililppejse(dot)dk in the download section of each product you will find a file in the download section - it's the same issue for all. File is set to open in stead of download, but this did not solve the issue. Link to comment Share on other sites More sharing options...
rialni Posted February 15, 2014 Author Share Posted February 15, 2014 When I go to the backoffice and look in attachments under 'catalogue' it looks like there's no files in each upload. The list is there, but when I go to edit for each file there's nothing there. Then when I go to the cpanel of the shop, all the files are correctly placed in the download folder? What could have happened, when I moved domain? Any ideas at all? Do I really need to upload all 180 files again, without knowing what happened? Link to comment Share on other sites More sharing options...
tuk66 Posted February 17, 2014 Share Posted February 17, 2014 The ps_attachment and ps_attachment_lang tables contain all records about the files in /download folder? Link to comment Share on other sites More sharing options...
rialni Posted February 17, 2014 Author Share Posted February 17, 2014 Looks like the pdf files are not pdf files anymore. They are all broken? When I download one of the files from the folder Download and try to open it directly from my desktop, the reader says 'file is damaged and cannot be repaired'. Looks like the records are all there. Maybe the files weren't optimized for fast web view? Could that have given this issue? (I didn't update them, my client did, so I'm not sure about the files configuration - but I do know that it worked to begin with) Thanks for replying Link to comment Share on other sites More sharing options...
prestashopninja Posted February 17, 2014 Share Posted February 17, 2014 When you download one of those PDF files in question via FTP, can you open it in your local computer? Link to comment Share on other sites More sharing options...
tuk66 Posted February 17, 2014 Share Posted February 17, 2014 Who knows. The files have no .pdf extension but should start with %PDF if you look in its source. Link to comment Share on other sites More sharing options...
prestashopninja Posted February 17, 2014 Share Posted February 17, 2014 Their extensions doesn't matter. If you could download a sample and attach it here, we could check if the file is damaged or not. Link to comment Share on other sites More sharing options...
rialni Posted February 17, 2014 Author Share Posted February 17, 2014 No pdf og %pdf in the file name and no I can't open it locally, when I download through FTP. I've tried to attach it here, but it says I'm not permitted to upload that kind of file (and now I wonder what kind of file it turned into ) Link to comment Share on other sites More sharing options...
tuk66 Posted February 17, 2014 Share Posted February 17, 2014 Share with http://sharegadget.com/ Link to comment Share on other sites More sharing options...
thx2012 Posted March 8, 2014 Share Posted March 8, 2014 So, what was the solution? I have same issue.. Link to comment Share on other sites More sharing options...
thx2012 Posted March 12, 2014 Share Posted March 12, 2014 I have same issue with no success in resolving. I created testing domain, then migrated a copy of my PS store v.1.4.4.1 and upgraded over to v.1.5.6.2. After resolving missing images, I now encounter an error in the download .pdf attachments: "There was an error opening this document. The file is damaged and could not be repaired." Trouble shooting steps.. First, I confirm .PDF files exist. The download folder was empty. Next, I uploaded the backup ‘download’ folder over to new PS.v.1.5.6.2. Finally, I recompile templates if the files have been updated.. Then Clear Smarty cache & Autoload cache. No success! Anyone have solution to this? Link to comment Share on other sites More sharing options...
tuk66 Posted March 15, 2014 Share Posted March 15, 2014 Try set output_handler to off. Link to comment Share on other sites More sharing options...
thx2012 Posted March 17, 2014 Share Posted March 17, 2014 (edited) Try set output_handler to off. Thank you for responding. I edited my php.ini file and adjusted the output_handler = Off I restarted Apache, Cleared smarty cache & Autoload cache.. The problem still exist. Any other suggestion? Edited March 17, 2014 by thx2012 (see edit history) Link to comment Share on other sites More sharing options...
marcis Posted March 26, 2014 Share Posted March 26, 2014 Did you try this? http://www.digitaldisseny.com/es/blog/207-prestashop-product-attachments-corrupted 1 Link to comment Share on other sites More sharing options...
thx2012 Posted March 26, 2014 Share Posted March 26, 2014 Did you try this? http://www.digitaldisseny.com/es/blog/207-prestashop-product-attachments-corrupted Thank you! Yes, now .pdfs work.. Link to comment Share on other sites More sharing options...
Ecomas Energosystem Posted April 15, 2015 Share Posted April 15, 2015 (edited) Hi, i have the same problem after i had to make a full backup from my local machine. At first when i tried to download a pdf attachement from the website it showed PDF FAILED TO LOAD, know after proceeding with the instructions from the link http://www.digitaldisseny.com/es/blog/207-prestashop-product-attachments-corrupted that MARCIS shared the PDF files are empty, plain white pages. Did someone confrunt this issue? Edited April 15, 2015 by ecomas (see edit history) Link to comment Share on other sites More sharing options...
Ecomas Energosystem Posted April 18, 2015 Share Posted April 18, 2015 (edited) Thank you! Yes, now .pdfs work.. Hi, how did you manage to make the pdf files to open? I followed the exact procedure in the link but now the pdf files are blank, i can open them but there are empty white pages. Edited April 29, 2015 by ecomas (see edit history) Link to comment Share on other sites More sharing options...
Honey93 Posted August 11, 2017 Share Posted August 11, 2017 uploading attachment is throwing the error. Can anybody help me out with it ? ContextErrorException in ProductOptions.php line 217:Notice: Undefined offset: 29in ProductOptions.php line 217 at ErrorHandler->handleError('8', 'Undefined offset: 29', '/var/www/html/prestashop/src/PrestaShopBundle/Form/Admin/Product/ProductOptions.php', '217', array('value' => '30', 'key' => 'ab08c594752cd9a581ebd8ee9b4612499c6122b2', 'index' => '30')) in ProductOptions.php line 217 at ProductOptions->PrestaShopBundle\Form\Admin\Product\{closure}('30', 'ab08c594752cd9a581ebd8ee9b4612499c6122b2', '30') at call_user_func(object(Closure), '30', 'ab08c594752cd9a581ebd8ee9b4612499c6122b2', '30') in DefaultChoiceListFactory.php line 165 at DefaultChoiceListFactory::addChoiceView('30', '30', object(Closure), array('ab08c594752cd9a581ebd8ee9b4612499c6122b2'), '1', null, array(), array(), array()) in DefaultChoiceListFactory.php line 231 at DefaultChoiceListFactory::addChoiceViewsGroupedBy(array('ab08c594752cd9a581ebd8ee9b4612499c6122b2' => '30'), object(Closure), array('30'), array('ab08c594752cd9a581ebd8ee9b4612499c6122b2'), '1', null, array(), array(), array()) in DefaultChoiceListFactory.php line 130 at DefaultChoiceListFactory->createView(object(ArrayChoiceList), array(), object(Closure), '1', null, null) in PropertyAccessDecorator.php line 232 at PropertyAccessDecorator->createView(object(ArrayChoiceList), array(), object(Closure), null, null, null) in CachingFactoryDecorator.php line 197 at CachingFactoryDecorator->createView(object(ArrayChoiceList), array(), object(Closure), null, null, null) in ChoiceType.php line 508 at ChoiceType->createChoiceListView(object(ArrayChoiceList), array('block_name' => null, 'disabled' => false, 'label_format' => null, 'translation_domain' => null, 'auto_initialize' => true, 'trim' => true, 'max_length' => null, 'pattern' => null, 'property_path' => null, 'mapped' => true, 'by_reference' => true, 'virtual' => null, 'method' => 'POST', 'action' => '', 'post_max_size_message' => 'The uploaded file was too large. Please try to upload a smaller file.', 'error_mapping' => array(), 'invalid_message' => 'This value is not valid.', 'invalid_message_parameters' => array(), 'allow_extra_fields' => false, 'extra_fields_message' => 'This form should not contain extra fields.', 'csrf_protection' => true, 'csrf_field_name' => '_token', 'csrf_message' => 'The CSRF token is invalid. Please try to resubmit the form.', 'intention' => null, 'empty_value' => object(Exception), 'label' => 'Attachments for this product:', 'read_only' => false, 'attr' => array('data' => array(array('id_attachment' => '30', 'file' => 'ab08c594752cd9a581ebd8ee9b4612499c6122b2', 'file_name' => 'Upload_.csv', 'file_size' => '236', 'mime' => 'text/plain', 'id_lang' => '1', 'name' => 'Excel File', 'description' => ''))), 'data_class' => null, 'expanded' => true, 'multiple' => true, 'empty_data' => array(), 'required' => false, 'error_bubbling' => false, 'label_attr' => array(), 'inherit_data' => false, 'compound' = ContextErrorException in ProductOptions.php line 217:Notice: Undefined offset: 29 Link to comment Share on other sites More sharing options...
Recommended Posts