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

Reply
 
Thread Tools

Файл через PHP
Old 12.04.2007, 17:07   #1
полюбому йес эм...
 
Mesrop's Avatar
 
Join Date: 02 2005
Location: near the computer
Age: 34
Posts: 3,243
Rep Power: 5
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

Old 12.04.2007, 17:28   #2
★★★★★★★★★★★★★
 
Hrach_Techie's Avatar
 
Join Date: 08 2004
Location: London, UK
Age: 46
Posts: 16,531
Rep Power: 8
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
Саурона спрашивал? он ас в пхп - напеши в личку или в жж спроси он там чаще чем тут ...
__________________
Мадмазель, Медам, Месье! "Глория" меняет курс и направляется в Кейптаун! Кому это не нравится будет расстрелян на месте. (с)

http://texneg.livejournal.com

Old 12.04.2007, 21:22   #3
Какое небо, *, Багдад!
 
knightmare's Avatar
 
Join Date: 10 2005
Location: Ереван
Posts: 1,682
Rep Power: 4
Default

см. на forum.vision.am
http://forum.vision.am/index.php?act=ST&f=87&t=11329
__________________
мордой об лавку
LISP is the only language that is truly beautiful.
d
.

Хочу трахнуть Nissan Skyline R34, и ездить на Alessandra Ambrosio

Old 13.04.2007, 06:50   #4
hov
В бой аргхххххххх!
 
hov's Avatar
 
Join Date: 09 2002
Location: Vik, Medieval Norway
Age: 43
Posts: 1,513
Rep Power: 5
Default

irikunot kdnem mi hat ktor.
__________________
Rock Hovhannes.

Дневник
Stryfe.Am - Coming Soon!

Old 13.04.2007, 07:27   #5
...overwined...
 
noone's Avatar
 
Join Date: 03 2003
Location: ...tortuga...
Posts: 3,429
Rep Power: 5
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
вы хоть понимаете как "резюм суппорт" работает?...
__________________
...let's be gods... let's by ugly...

Old 13.04.2007, 09:38   #6
полюбому йес эм...
 
Mesrop's Avatar
 
Join Date: 02 2005
Location: near the computer
Age: 34
Posts: 3,243
Rep Power: 5
Default

Quote:
вы хоть понимаете как "резюм суппорт" работает?...
chto-to miqich patkeracnum em, dra hamar chto-to indz tvuma vor PHP-ov hnaravor chi...

Old 13.04.2007, 09:46   #7
Какое небо, *, Багдад!
 
knightmare's Avatar
 
Join Date: 10 2005
Location: Ереван
Posts: 1,682
Rep Power: 4
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 кардас
__________________
мордой об лавку
LISP is the only language that is truly beautiful.
d
.

Хочу трахнуть Nissan Skyline R34, и ездить на Alessandra Ambrosio

Old 13.04.2007, 22:05   #8
полюбому йес эм...
 
Mesrop's Avatar
 
Join Date: 02 2005
Location: near the computer
Age: 34
Posts: 3,243
Rep Power: 5
Default

Все! стацвец! шаат шноракалутюн, knightmare!!!

Old 30.01.2008, 15:24   #9
Младенец
 
Javakhk's Avatar
 
Join Date: 07 2006
Location: Javakhk
Age: 56
Posts: 9
Rep Power: 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




Реклама:
реклама
Buy text link .

All times are GMT. The time now is 01:44.
Top

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