<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Displaying attachments corrupted]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=10715&amp;type=atom" />
	<updated>2026-03-16T17:11:01Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=10715</id>
		<entry>
			<title type="html"><![CDATA[Re: Displaying attachments corrupted]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=43845#p43845" />
			<content type="html"><![CDATA[<p>I should have mentioned that the files on the server are not corrupted; manually downloading them via SMB and adding the appropriate extension (jpg/png/pdf) makes the files viewable.</p>]]></content>
			<author>
				<name><![CDATA[fraserks]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=41872</uri>
			</author>
			<updated>2026-03-16T17:11:01Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=43845#p43845</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Displaying attachments corrupted]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=43844#p43844" />
			<content type="html"><![CDATA[<p>When I am in the attachments screen and click on either the download button or the view button, a pop-up opens, but the attachment isn&#039;t displayed.</p><p>trial and error in attachments.php around line 37, replacing the following:</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $type = ($row[&#039;filetype&#039;]) ? $row[&#039;filetype&#039;] : &#039;application/octet-stream&#039;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; header(&quot;Content-type: &quot;.$type);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; header(&#039;Content-Length: &#039;.$row[&#039;filesize&#039;]);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; header(&quot;Content-Disposition: inline&quot;);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo file_get_contents(company_path(). &quot;/attachments/&quot;.$row[&#039;unique_name&#039;]);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit();</p><br /><p>with</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; header( &quot;location: &quot; . $_SERVER[&#039;PHP_SELF&#039;] . &quot;/../&quot; . company_path(). &quot;/attachments/&quot;.$row[&#039;unique_name&#039;] );<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit();</p><p>works.&nbsp; I don&#039;t see any security issue by passing a URL instead of a stream?</p>]]></content>
			<author>
				<name><![CDATA[fraserks]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=41872</uri>
			</author>
			<updated>2026-03-16T17:09:08Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=43844#p43844</id>
		</entry>
</feed>
