<?php

	$path = $_POST[nome];
	$filename = str_replace("remessa/","",$_POST[nome]);
	header('Content-Transfer-Encoding: binary');  // For Gecko browsers mainly
	header('Accept-Ranges: bytes');  // Allow support for download resume
	header('Content-Length: ' . filesize($path));  // File size
	header('Content-Encoding: none');
	header('Content-Type: application/txt');  // Change the mime type if the file is not PDF
	header('Content-Disposition: attachment; filename=' . $filename);  // Make the browser display the Save As dialog
	readfile($path);  // This is necessary in order to get it to actually download the file, otherwise it will be 0Kb

