Hi all,
At present, I have a form that submits a URL to a page (via POST) amongst other data. The page then adds the data it needs to into a MySQL database, after which it then proceeds to download the file specified in the posted URL. Here’s the code so far…
[CODE] //set download date and time to time after download has completed… I think… otherwise it will just be the time the form was posted.
$downloaddate = date(‘Y-m-d’);
$downloadtime = date(‘H:i:s’);
//Insert download date/time into tblFilesUploaded
mysql_query(“UPDATE tblFilesUploaded SET DownloadedFileDate=’ $downloaddate’, DownloadedFileTime=’ $downloadtime’ WHERE RecordNum=’ $_POST[RecordToUpdate]’ “)
or die(mysql_error());
//set filename and download file
$file = $DownloadLocation.$_POST[‘FileToDownload’];
if (file_exists($file)) {
header(‘Content-Description: File Transfer’);
header(‘Content-Type: application/zip’);
header(‘Content-Disposition: attachment; filename=’.basename($file));
header(‘Content-Transfer-Encoding: binary’);
header(‘Expires: 0’);
header(‘Cache-Control: must-revalidate, post-check=0, pre-check=0’);
header(‘Pragma: public’);
header(‘Content-Length: ‘ . filesize($file));
ob_clean();
flush();
readfile($file);
//////////////////////////////////////
//$tabselected = 2;
//header(‘Location: http://www.cityscope.com.au/inhouse/cityscope-DUM.php?tabselection=’.$tabselected);
//////////////////////////////////////
}
What I would like is after the file has download, it refreshes the current page to reflect the new data that was just uploaded.
I have tried several ways of doing this with no luck, one of which you can see commented out and surrounded by ////////////////
Anyone know if this is possible or not… and if possible, how?
Many thanks,
Chris