Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> download mp3
zalew
post 31.03.2003, 21:41:34
Post #1





Grupa: Zarejestrowani
Postów: 407
Pomógł: 0
Dołączył: 24.10.2002
Skąd: warszawa

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


manual mowi:

Cytat
if you want to have a link to an mp3 on your website, but don't want quicktime to load it, but rather download it to your machine, use this php script where $mp3name is the name of the mp3 without the .mp3 extension (do this to keep people from leeching mp3s from your site):
[php:1:05d886be69]<?php
header("Cache-control: private");
header("Content-Type: application/mp3");
header("Content-Disposition: attachment; filename=$mp3name.mp3");
?>[/php:1:05d886be69]


tak tez zrobilem, i wyrzuca poprawnie okno do zapisu pliku, nazwe ze zmiennej rozpoznaje, ale nie sciaga pliku tylko zapisuje mi na dysku plik o rozmiarze 0kb...

potem przeczytalem tez inne rozwiazania:
Cytat
If you want to force browsers to download the content and not to open it automaticaly, as a PDF or DOC files, use:

[php:1:05d886be69]<?php
header("Content-type: application/octet-stream");
// probowalem tez
header("Content-type: application/force-download");
//dodawalem tez
header("Content-Length: ".filesize("$mp3name.mp3"));
?>[/php:1:05d886be69]


ale tez nic... caly czas pusty plik...
wie ktos moze czemu? czego brakuje ...


--------------------
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 2)
gdr
post 31.03.2003, 22:00:02
Post #2





Grupa: Zarejestrowani
Postów: 6
Pomógł: 0
Dołączył: 31.03.2003
Skąd: z Amigi

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


A, to zalezy od tego, co napisales dalej w kodzie.


--------------------
--
GDR! / Lucid Dreams Entertaiment
GG:2892974 gdr(malpa)ldreams.net
http://www.GDR.w.pl/ | http://ldreams.net/
Go to the top of the page
+Quote Post
zalew
post 31.03.2003, 22:15:06
Post #3





Grupa: Zarejestrowani
Postów: 407
Pomógł: 0
Dołączył: 24.10.2002
Skąd: warszawa

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


dzieki ze zworicles uwage... czasme czlowiek sie zapedzi w technologie a to glupoty robia kiksy smile.gif

[php:1:d395abf869]<?php
$mp=fopen("$mp3name.mp3", "rb");
fpassthru($mp);
?>[/php:1:d395abf869]

zle podstawilem zmienne tu na dole rolleyes.gif
juz dziala, dzieki zz zainteresowanie, pozrawiam :wink:


--------------------
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: 19.07.2025 - 09:53