Wednesday, August 11, 2010

Restrict unwanted files upload by using FileZilla

By using filters in filezilla we can avoid unwanted files in remote server

Showing Filters

To show and configure filters:

select "View > Filename filters...".

This will bring up the 'Directory listing filters' dialog box, that shows :

  • on the left side : the local filters
  • on the right side : the remote filters.

Multiple filters may be active at a time — those filters that are active will have a check next to them.

We can add/edit/delete filters by clicking edit filters button
once you have finished click apply that's all

Tuesday, August 10, 2010

Fixing Internet explorer Content-type and Content-Disposition issues using PHP

When you add download files option to your pages using PHP. you need to use following code to fix IE related issues

$filename = "myfile" . ".doc";
header('Content-Type: application/msword');
header('Expires: ' . gmdate('D, d M Y H:i:s') . 'GMT');
header('Content-Disposition: attachment; filename="' . $filename . '"');

if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE')) {
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
} else {
header('Pragma: no-cache');