<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[FrontAccounting forum — Displaying attachments corrupted]]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=10715</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=10715&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Displaying attachments corrupted.]]></description>
		<lastBuildDate>Mon, 16 Mar 2026 17:11:01 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Displaying attachments corrupted]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=43845#p43845</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (fraserks)]]></author>
			<pubDate>Mon, 16 Mar 2026 17:11:01 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=43845#p43845</guid>
		</item>
		<item>
			<title><![CDATA[Displaying attachments corrupted]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=43844#p43844</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (fraserks)]]></author>
			<pubDate>Mon, 16 Mar 2026 17:09:08 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=43844#p43844</guid>
		</item>
	</channel>
</rss>
