Witam,
Daję początek pliku:
<?php
include 'connection.php';
$plik_tmp = $_FILES['plik']['tmp_name'];
$name = $_FILES['plik']['name'];
$size = $_FILES['plik']['size'];
$type = $_FILES['plik']['type'];
$text = $_FILES['plik']['file'];
$wybrane = $_POST['wybrane'];
$zappytanko = mysql_query("select * from nr_rachunku where id_nr='".$wybrane."'"); $k = $_POST['k'];
$four = $zapp['fourcyfry'];
$numer = $zappw;
// wczytanie starych danych
// otwarcie pliku do odczytu
$fp = fopen($name, "r+");
//odczytanie danych
// echo $niewiem;
//echo $str;
// zamknięcie pliku
Potem z treści wczytanego pliku korzystam...
I z tej treści tworzę ( w php ) stringa, którego daję do pliku tekstowego i pobieram.
if($pow !== 'no') {
//First, see if the file exist
if (!is_file('plik.sta')) { die("<b>404 File not found!</b>"); }
//Gather relevent info about file
//This will set the Content-Type to the appropriate setting for the file
switch( $file_extension ) {
case "sta": $ctype="text/plain";
break;
default: $ctype="text/plain";
}
//Begin writing headers
header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Cache-Control: public"); header("Content-Description: File Transfer");
//Use the switch-generated Content-Type
header("Content-Type: $ctype");
//Force the download
@$header="Content-Disposition: attachment; filename=".$filename."";
header("Content-Transfer-Encoding: binary"); header("Content-Length: ".$len); }
?>
I teraz, jak zrobić, by zawsze pobierało w tym samym kodowaniu co wczytywało?
Chamsko odświeżam