<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Failed to load PDF document]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=7465&amp;type=atom" />
	<updated>2018-05-04T10:22:24Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=7465</id>
		<entry>
			<title type="html"><![CDATA[Re: Failed to load PDF document]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=31564#p31564" />
			<content type="html"><![CDATA[<p>The document stands delinked from the transaction. Manually delete it physically if it is a permissions issue. It is possible that one may want to link it to another transaction otherwise.</p><p>The code for deletion is in lines 145 to 154 in&nbsp; <strong>admin/attachments.php</strong>:<br /></p><div class="codebox"><pre><code>if ($Mode == &#039;Delete&#039;)
{
    $row = get_attachment($selected_id);
    $dir =  company_path().&quot;/attachments&quot;;
    if (file_exists($dir.&quot;/&quot;.$row[&#039;unique_name&#039;]))
        unlink($dir.&quot;/&quot;.$row[&#039;unique_name&#039;]);
    delete_attachment($selected_id);    
    display_notification(_(&quot;Attachment has been deleted.&quot;)); 
    $Mode = &#039;RESET&#039;;
}</code></pre></div><p>The <strong>unlink</strong> statement clearly is supposed to delete the file.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2018-05-04T10:22:24Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=31564#p31564</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Failed to load PDF document]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=31563#p31563" />
			<content type="html"><![CDATA[<p>Dears,</p><p>Not the same problem but deleting an attachment from frontaccounting interface does not delete it from the company/x/attachment folder. Is this how it should be?</p>]]></content>
			<author>
				<name><![CDATA[rafat]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=41964</uri>
			</author>
			<updated>2018-05-04T09:05:14Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=31563#p31563</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Failed to load PDF document]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=31416#p31416" />
			<content type="html"><![CDATA[<p>Was able to solve the problem. Actually, for some reason, permission on attachments repository was changed. Add the +rw permission. Solved my problem.</p>]]></content>
			<author>
				<name><![CDATA[diigiit]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=42127</uri>
			</author>
			<updated>2018-04-13T21:56:24Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=31416#p31416</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Failed to load PDF document]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=31415#p31415" />
			<content type="html"><![CDATA[<p>Hello,<br />This is a very weird bug and still try to understand it. Hope someone can help.<br />I was working on company accounting adding journal entries and attaching PDF file for each invoice entered. Frontaccounting is online. Everything was working ok (in fact it is working since months). Was able to attach and see PDF invoices in Frontaccounting.<br />Suddenly, with no reason, PDF attachments stopped working with error message &quot;Failed to load PDF document&quot;.<br />Release number is 2.3.22. <br />I first suspected a corrupted attached file or a browser issue. The problem is the same whether I am using Firefox or Chrome.<br />The weird thing is that the problem is the same on any other computer including the one that are using a local database and installation. <br />After investigation, it looks like the problem is located inside /admin/attachments.php<br />The piece of code<br />echo file_get_contents(company_path(). &quot;/attachments/&quot;.$row[&#039;unique_name&#039;]);<br />point to a non existing file; $row[&#039;unique_name&#039;] return unique_name found on 0_attachments table for the file but this file does not exists under company/0/attachments/ repository.<br />Backups files shows exactly the same thing.<br />How attached file are stored?</p>]]></content>
			<author>
				<name><![CDATA[diigiit]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=42127</uri>
			</author>
			<updated>2018-04-13T18:53:50Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=31415#p31415</id>
		</entry>
</feed>
