Armenian Knowledge Base  

Go Back   Armenian Knowledge Base > Technical sections > Languages, Compilers, Interpreters
Register

Reply
 
LinkBack Thread Tools
Old 12.04.2007, 18:07   #1
полюбому йес эм...
 
Mesrop's Avatar
 
Join Date: 02 2005
Location: near the computer
Age: 26
Posts: 3,243
Downloads: 3
Uploads: 0
Reputation: 129 | 3
Default Файл через PHP

inchpes kareli e faile output anel cherez php? (for download)

PHP Code:
<?
header
('Content-Type: application/octet-stream');
header('Accept-Ranges: bytes');
header('Content-Length: ' .filesize($file));
header('Content-Disposition: attachment; filename="'.basename($file"/").'"');
readfile($file);
?>

yes sens em arel, uxaki senc ham down-i aragutyunn a shat qich, hamel "Resume support" (for download accelerators) chka
urish inch karajarkeq?
mersi
Reply With Quote
Old 12.04.2007, 18:28   #2
★★★★★★★★★★★★★
 
Hrach_Techie's Avatar
 
Join Date: 08 2004
Location: London, UK
Age: 38
Posts: 16,531
Downloads: 8
Uploads: 0
Reputation: 482 | 6
Default

Quote:
Originally Posted by Mesrop View Post
inchpes kareli e faile output anel cherez php? (for download)

PHP Code:
<?
header
('Content-Type: application/octet-stream');
header('Accept-Ranges: bytes');
header('Content-Length: ' .filesize($file));
header('Content-Disposition: attachment; filename="'.basename($file"/").'"');
readfile($file);
?>
yes sens em arel, uxaki senc ham down-i aragutyunn a shat qich, hamel "Resume support" (for download accelerators) chka
urish inch karajarkeq?
mersi
Саурона спрашивал? он ас в пхп - напеши в личку или в жж спроси он там чаще чем тут ...
Reply With Quote
Old 12.04.2007, 22:22   #3
Какое небо, *, Багдад!
 
knightmare's Avatar
 
Join Date: 10 2005
Location: Ереван
Posts: 1,682
Downloads: 16
Uploads: 0
Reputation: 99 | 3
Default

см. на forum.vision.am
http://forum.vision.am/index.php?act=ST&f=87&t=11329
Reply With Quote
Old 13.04.2007, 07:50   #4
В бой аргхххххххх!
 
hov's Avatar
 
Join Date: 09 2002
Location: Vik, Medieval Norway
Age: 35
Posts: 1,513
Downloads: 12
Uploads: 0
Reputation: 43 | 3
Default

irikunot kdnem mi hat ktor.
Reply With Quote
Old 13.04.2007, 08:27   #5
...overwined...
 
noone's Avatar
 
Join Date: 03 2003
Location: ...tortuga...
Posts: 3,429
Downloads: 3
Uploads: 0
Reputation: 158 | 3
Default

Quote:
Originally Posted by Mesrop View Post
inchpes kareli e faile output anel cherez php? (for download)

PHP Code:
<?
header
('Content-Type: application/octet-stream');
header('Accept-Ranges: bytes');
header('Content-Length: ' .filesize($file));
header('Content-Disposition: attachment; filename="'.basename($file"/").'"');
readfile($file);
?>
yes sens em arel, uxaki senc ham down-i aragutyunn a shat qich, hamel "Resume support" (for download accelerators) chka
urish inch karajarkeq?
mersi
вы хоть понимаете как "резюм суппорт" работает?...
Reply With Quote
Old 13.04.2007, 10:38   #6
полюбому йес эм...
 
Mesrop's Avatar
 
Join Date: 02 2005
Location: near the computer
Age: 26
Posts: 3,243
Downloads: 3
Uploads: 0
Reputation: 129 | 3
Default

Quote:
вы хоть понимаете как "резюм суппорт" работает?...
chto-to miqich patkeracnum em, dra hamar chto-to indz tvuma vor PHP-ov hnaravor chi...
Reply With Quote
Old 13.04.2007, 10:46   #7
Какое небо, *, Багдад!
 
knightmare's Avatar
 
Join Date: 10 2005
Location: Ереван
Posts: 1,682
Downloads: 16
Uploads: 0
Reputation: 99 | 3
Default

Quote:
Originally Posted by Mesrop View Post
chto-to miqich patkeracnum em, dra hamar chto-to indz tvuma vor PHP-ov hnaravor chi...
ынаравора, аперь, просто петка HTTP-i RFC кардас
Reply With Quote
Old 13.04.2007, 23:05   #8
полюбому йес эм...
 
Mesrop's Avatar
 
Join Date: 02 2005
Location: near the computer
Age: 26
Posts: 3,243
Downloads: 3
Uploads: 0
Reputation: 129 | 3
Default

Все! стацвец! шаат шноракалутюн, knightmare!!!
Reply With Quote
Old 30.01.2008, 15:24   #9
Младенец
 
Javakhk's Avatar
 
Join Date: 07 2006
Location: Javakhk
Age: 48
Posts: 9
Downloads: 0
Uploads: 0
Reputation: 0 | 0
Default

Assume your file is my_file.txt, and you wish to read it into the variable $preset in PHP. Then simply write:

PHP Code:
$file="my_file.txt";
$preset="";
$handle fopen($file"r");
while (!
feof($handle)) {
$buffer fgets($handle4096);
$preset="$preset$buffer";
}
fclose($handle); 
Reply With Quote
Sponsored Links
Reply

Thread Tools


На правах рекламы:
реклама

All times are GMT. The time now is 01:19.


Powered by vBulletin® Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.