html question , webhost issue?

user

New member
i uploaded a file to the website that is a zip file , but i uploaded it as extension .zip_ in order to be accepted , now the users don't know how to rename it as .zip , is there an html code that downloads the file as .zip but in the webhost is of extension .zip_
i ask for anything php htm javascript
thanks in advance
 
Yes, there is a method for PHP.

<?php
// We'll be outputting a PDF
header('Content-type: application/pdf');

// It will be called downloaded.pdf
header('Content-Disposition: attachment; filename="downloaded.pdf"');

// The PDF source is in original.pdf
readfile('original.pdf');
?>

Just an example from the PHP manual.
Of course you need to adjust a couple of things like setting the Content-Type to application/zip.
 
Back
Top