Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php] buforowanie
--gomu--
post 21.01.2008, 04:03:39
Post #1





Goście







witam, napisalem skrypcik ktory udaje dany plik odczytujac go z buforowaniem, ale nie dziala, zabraklo mi pomyslow :/

Kod
<?php



$file = './r_b1.rar';
$fakename = "Archiwum.rar";
header("Cache-control: private");
header("Content-Type: application/octet-stream");
header("Content-Length: ".filesize($file));
header("Content-Disposition: attachment; filename=".basename($fakename));
header("Connection: Close");

$fp = fopen ($file, "r");


while(!feof($fp)) {
        $file_buffer = fread($fp, 2048);
        echo $file_buffer;

?>


Prosze o pomoc, co tutaj jest zle?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 6)
--gomu--
post 21.01.2008, 04:06:58
Post #2





Goście







Aha, jeszcze jedno pytanko, jak beda wygladaly naglowki dla pliku jpg?
nie chodzi mi o samo "header('Content-Type: image/jpeg');" tylko calosc az do readfile().
Go to the top of the page
+Quote Post
sobstel
post 21.01.2008, 10:15:13
Post #3





Grupa: Zarejestrowani
Postów: 853
Pomógł: 25
Dołączył: 27.08.2003
Skąd: Katowice

Ostrzeżenie: (0%)
-----


szukaj u źródeł


--------------------
"If debugging is the process of removing bugs, then programming must be the process of putting them in..."
sobstel.org
Go to the top of the page
+Quote Post
--gomu--
post 21.01.2008, 11:14:26
Post #4





Goście







Nic pomocnego tam nie widze...
Go to the top of the page
+Quote Post
sobstel
post 21.01.2008, 12:35:17
Post #5





Grupa: Zarejestrowani
Postów: 853
Pomógł: 25
Dołączył: 27.08.2003
Skąd: Katowice

Ostrzeżenie: (0%)
-----


Cytat(-gomu- @ 21.01.2008, 11:14:26 ) *
Nic pomocnego tam nie widze...


a powinieneś. zobacz jak tam obsługiwane jest buforowanie. w twoim przykładzie nie zwracasz nawet nagłówka not-modified, czy expire przez co twoj plik nigdy nie będzie buforowany.


--------------------
"If debugging is the process of removing bugs, then programming must be the process of putting them in..."
sobstel.org
Go to the top of the page
+Quote Post
--gomu--
post 21.01.2008, 13:02:53
Post #6





Goście







sory ale nic tam nie widze...
Go to the top of the page
+Quote Post
--gomu--
post 24.01.2008, 17:01:48
Post #7





Goście







Nic sie nei zmienilo, nadal nie wiem jak zrobic czytanie z buforowaniem, i nic nie widze w tym zalaczniuku....
Prosze o pomoc. jakies dodatkowe naprowadzenie... cokolwiek.,..
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 14.08.2025 - 03:34