[Vtigercrm-commits] [vtiger-commits] r9068 - in /customerportal/trunk: Tickets/TicketDetail.php index.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Tue Aug 22 09:04:39 EDT 2006


Author: saraj
Date: Tue Aug 22 07:04:35 2006
New Revision: 9068

Log:
* Modified to handle the attachments

Modified:
    customerportal/trunk/Tickets/TicketDetail.php
    customerportal/trunk/index.php

Modified: customerportal/trunk/Tickets/TicketDetail.php
==============================================================================
--- customerportal/trunk/Tickets/TicketDetail.php (original)
+++ customerportal/trunk/Tickets/TicketDetail.php Tue Aug 22 07:04:35 2006
@@ -180,7 +180,7 @@
 			$list .= '
 			   <tr>
 				<td class="dvtCellLabel" align="right">'.$attachments_title.'</td>
-				<td class="dvtCellInfo" colspan="3"><a href="index.php?module=Tickets&action=downloadfile&fileid='.$fileid.'&filename='.$filename.'&filetype='.$filetype.'&filesize='.$filesize.'">'.ltrim($filename,$ticketid.'_').'</a></td>
+				<td class="dvtCellInfo" colspan="3"><a href="index.php?downloadfile=true&fileid='.$fileid.'&filename='.$filename.'&filetype='.$filetype.'&filesize='.$filesize.'">'.ltrim($filename,$ticketid.'_').'</a></td>
 			   </tr>';
 		}
 	}

Modified: customerportal/trunk/index.php
==============================================================================
--- customerportal/trunk/index.php (original)
+++ customerportal/trunk/index.php Tue Aug 22 07:04:35 2006
@@ -46,6 +46,27 @@
 	if($_SESSION['customer_id'] != '')
 	{
 		$is_logged = 1;
+
+		//Added to download attachments
+		if($_REQUEST['downloadfile'] == 'true')
+		{
+			$filename = $_REQUEST['filename'];
+			$fileType = $_REQUEST['filetype'];
+			$fileid = $_REQUEST['fileid'];
+			$filesize = $_REQUEST['filesize'];
+
+			$contentname = $fileid.'_filecontents';
+			$fileContent = $_SESSION[$contentname];
+
+			header("Content-type: $fileType");
+			header("Content-length: $filesize");
+			header("Cache-Control: private");
+			header("Content-Disposition: attachment; filename=$filename");
+			header("Content-Description: PHP Generated Data");
+			echo base64_decode($fileContent);
+
+			exit;
+		}
 		if($_REQUEST['module'] != '' && $_REQUEST['action'] != '')
 		{
 			$module = $_REQUEST['module']."/";





More information about the vtigercrm-commits mailing list