[Vtigercrm-commits] [vtiger-commits] r10687 - in /customerportal/trunk: Tickets/TicketDetail.php index.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Sat Apr 14 04:07:15 EDT 2007
Author: richie
Date: Sat Apr 14 02:07:08 2007
New Revision: 10687
Log:
* Modified the file download process ie., previously we stored the filecontents in the session so that when click on a file we simply display the content from session. This will save transaction time to server. But now we get the content from server when we click on file link. In this we can download large files which will not crash browser because of session storage, Fixed #3646
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 Sat Apr 14 02:07:08 2007
@@ -167,10 +167,6 @@
$filetype = $files_array[$j]['filetype'];
$filesize = $files_array[$j]['filesize'];
$fileid = $files_array[$j]['fileid'];
- $filecontents = $files_array[$j]['filecontents'];
- $contentname = $fileid.'_filecontents';
-
- $_SESSION[$contentname] = $filecontents;
//To display the attachments title
$attachments_title = '';
Modified: customerportal/trunk/index.php
==============================================================================
--- customerportal/trunk/index.php (original)
+++ customerportal/trunk/index.php Sat Apr 14 02:07:08 2007
@@ -56,15 +56,17 @@
$fileid = $_REQUEST['fileid'];
$filesize = $_REQUEST['filesize'];
- $contentname = $fileid.'_filecontents';
- $fileContent = $_SESSION[$contentname];
+ //we have to get the content by passing the customerid, fileid and filename
+ $customerid = $_SESSION['customer_id'];
+ $params = Array('id'=>$customerid,'fileid'=>$fileid,'filename'=>$filename);
+ $fileContent = $client->call('get_filecontent', $params, $Server_Path, $Server_Path);
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);
+ echo base64_decode($fileContent[0]);
exit;
}
More information about the vtigercrm-commits
mailing list