Archive for the 'Web Development' Category
<?php
//———————————————– //
Function to force download of a file
//———————————————–
public function download($file_name, $file_path, $mime_type)
{
header(‘Content-Description: File Transfer’);
header(‘Content-Type: ‘.$mime_type);
header(‘Content-Disposition: attachment; filename="’.$file_name.‘";’);
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header(‘Content-Length: ‘ . filesize($file_path));
@readfile($file_path);
die();
}
?>
Sphere: Related Content
If you’re compiling php 5Â on CentOS Linux with the IMAP functionality enabled you may get this error when restarting Apache:Â
“/usr/lib/libc-client.so.0: undefined symbol: mm_dlog”
I have no idea what causes this but you can get round it by compiling it as a shared module (http://scriptmantra.info/admin_ahead_com/cPanel_AP2_PHP5.html)
I have just compiled php 5.2.3 and the error still exists (if you look [...]
//———————————————–
// Function to force download of a file
//———————————————–
public function download($file_name, $file_path, $mime_type)
{
header(‘Content-Description: File Transfer’);
header(‘Content-Type: ‘.$mime_type);
header(‘Content-Disposition: attachment; filename="’.$file_name.‘";’);
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header(‘Content-Length: ‘ . filesize($file_path));
@readfile($file_path);
die();
}
Sphere: Related Content
I recently found rentacoder.com and decided to have a look at how the site works, and how it may be of use to someone such as myself who does to odd bit of freelance web development work.
Rent a coder’s setup is pretty simple, people who need jobs done post the job plus a price range [...]
From this blog you can see the kind of things that interest me and I write about.
To aid me when writing content I use certain plug-ins to the core system to add in the functionality I require.
What follows is a list of the plug-ins I use to achieve the output you see from post to [...]
This is my archive of regular expressions for use in php usually with the preg_match type functions. If you can improve on these I’d like to know as they are mostly just harvested from other sources as I need them and it’s possible they could be improved:
This code isn’t strictly correct as word press’s inbuilt [...]
Well it’s the end of the day at work and after 8 hours of picking csv spreadsheets to bits I find myself with nothing left to aside from looking out of the window into the night and waiting for a phone call from one of our partners - and as such I decided to be [...]