Jump to content

Download with php


Gruzin

Recommended Posts

[quote author=Jenk link=topic=107696.msg432573#msg432573 date=1158050314]
[code]<?php

header('Content-disposition: attachment');
readfile('/path/to/file.txt');

?>[/code][/code]
[/quote]

I need something like this: when user clicks on a link, I want to download the file without promting the user. The example above asks user download or not the file... Thanks anyway. Still I have no idea how to do that, any suggestions will be greatly appreciated.
Link to comment
https://forums.phpfreaks.com/topic/20436-download-with-php/#findComment-90269
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.