Forum » Izdelava spletišč » Download
Download
XzupanX ::
Na spletni strani bi rad naredil, tako da bi si lahko obiskovalci zdownloadali neko datoteko.. kako to naredim ?
- premaknil iz Programiranje: bluefish ()
VoidRay ::
<form><input type="button" value="Download Now" onClick="window.location.href='lokacija na serverju?'"></form>
techfreak :) ::
$attachment_location = $_SERVER["DOCUMENT_ROOT"] . "/file.zip"; if (file_exists($attachment_location)) { header($_SERVER["SERVER_PROTOCOL"] . " 200 OK"); header("Cache-Control: public"); // needed for i.e. header("Content-Type: application/zip"); header("Content-Transfer-Encoding: Binary"); header("Content-Length:".filesize($attachment_location)); header("Content-Disposition: attachment; filename=file.zip"); readfile($attachment_location); die(); } else { die("Error: File not found."); }
Zamenjaj file.zip z imenom tvoje slike.
Zgodovina sprememb…
- spremenil: techfreak :) ()
Vredno ogleda ...
Tema | Ogledi | Zadnje sporočilo | |
---|---|---|---|
Tema | Ogledi | Zadnje sporočilo | |
» | Javascript DOM based XSS vulnerabilityOddelek: Programiranje | 2931 (2353) | MrStein |
» | Download vsebine strani s JSOddelek: Izdelava spletišč | 2585 (1883) | MrBrdo |
» | PHP + MySQL excel export pomoč?Oddelek: Izdelava spletišč | 1512 (1359) | sumoborac |
» | PHP autentikacija - problemOddelek: Izdelava spletišč | 1626 (1431) | krho |
» | backup preko omrežjaOddelek: Pomoč in nasveti | 1066 (950) | romario |