Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> + w nazwie pliku na uploadzie = Problem
Tabus
post
Post #1





Grupa: Zarejestrowani
Postów: 65
Pomógł: 0
Dołączył: 22.03.2008

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


Witam mam problem z uploadem oto link do niego

http://www.upload-triosat.pl/

problem tkwi w tym że jeżeli ktoś wżuci plik z nazwą np: "D+ _OK_KEY.zip"
to w Panelu administratora nie mogę usunąc tego pliku ani zeedytować jego nazwy gdy chcę go usunąc wyskakuje mi nastepujący błąd:

Kod
Error: w bazie nie ma takiego pliku. (data/D _OK_KEY.zip)
[b]Warning[/b]:  Cannot modify header information - headers already sent by (output started at /home/uploadts/ftp/dots/index.php:111) in [b]/home/uploadts/ftp/dots/index.php[/b] on line [b]215



gdy wchodzę w edycję wyskakuje:

nazwa pliku: D _OK_KEY.zip

Kod
[/b][b]Warning[/b]:  file_get_contents(opisy/D _OK_KEY.zip.opis) [[url="http://uploadts.nazwa.pl/dots/function.file-get-contents"]function.file-get-contents[/url]]: failed to open stream: No such file or directory in [b]/home/uploadts/ftp/dots/index.php[/b] on line [b]324


po zmianie nazwy na :[/b]dsds.zip i zatwierdzeniu wyskakuje

Kod
[/b][b]Warning[/b]:  rename(data/D _OK_KEY.zip,data/dsds.zip) [[url="http://uploadts.nazwa.pl/dots/function.rename"]function.rename[/url]]: No such file or directory in [b]/home/uploadts/ftp/dots/index.php[/b] on line [b]336[/b]

[b]Warning[/b]:  Cannot modify header information - headers already sent by (output started at /home/uploadts/ftp/dots/index.php:336) in [b]/home/uploadts/ftp/dots/index.php[/b] on line [b]215


z góry dziękuje za odpowiedz i pozdrawiam
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Tabus
post
Post #2





Grupa: Zarejestrowani
Postów: 65
Pomógł: 0
Dołączył: 22.03.2008

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


nie jestem pewny czy to jest to.

Kod
//progressbar upload
if ($config['upload_progressbar']){
if (isset($_GET['sid'])) {
$sid = $_GET['sid'];
$tmp_dir = $config['upload_tmpdir'];
$sid = ereg_replace("[^a-zA-Z0-9]","",$sid);//clean sid
$file = $tmp_dir.'/'.$sid.'_qstring';
if(!file_exists($file)) {
$errormsg = $lang['upload_error_sid'];
} else {
$qstr = join("",file($file));
//parse_str($qstr);
parse_str($qstr, $_POST);

//cleaning shit
$exts = array("_flength","_postdata","_err","_signal","_qstring");
foreach($exts as $ext) {
if(file_exists("$tmp_dir/$sid$ext")) {
@unlink("$tmp_dir/$sid$ext");
}
}

//setting vars like without progressbar
$_FILES['file']['name']=basename($_POST['file']['name']['0']);
$_FILES['file']['size']=$_POST['file']['size']['0'];
$_FILES['file']['tmp_name']=$_POST['file']['tmp_name']['0'];
}
} else if (isset($_POST['errormsg'])) {
$errormsg = urldecode($_POST['errormsg']);
if ($errormsg =="The maximum upload size has been exceeded")
$errormsg = $lang['upload_error_sizelimit'].' ('.getfilesize($max_filesize).').';
}
}

//uploading
if (isset($_FILES['file'])) {
if ($config['protect_upload']) authorize();
uploadfile($_FILES['file'], $_SERVER["REMOTE_ADDR"]);
}

if (isset($zbanujxD)) {
authorize();
$uah = fopen('zabanowani.txt', 'a+');
fwrite($uah, $zbanujxD.' ');
fclose($uah);
kierowca();
}

function kierowca(){
header('Location:'.rooturl());
return;
}

function uploadfile($file, $ipek) {
global $config, $lang, $max_filesize, $errormsg,$dir;

if ($file['error']!=0) {
$errormsg = $lang['upload_error'][$file['error']];
return;
}

//determine filename
$filename=$file['name'];
if (isset($_POST['filename']) && $_POST['filename']!="") $filename=$_POST['filename'];
$filename=basename($filename);
$filename=explode(".",basename($filename));
$ext = $filename[count($filename)-1];
unset($filename[count($filename)-1]);
$filename=join('_',$filename).'.'.$ext;

if (!in_array(strtolower(extname($filename)), $config['allowed_ext'])) {
$errormsg = $lang['upload_badext'];
return;
}

$filesize=$file['size'];
if ($filesize > $max_filesize) {
@unlink($file['tmp_name']);
$errormsg = $lang['upload_error_sizelimit'].' ('.getfilesize($max_filesize).').';
return;
}

$filedest = $config['storage_path'].'/'.$filename;
if (file_exists($filedest) && !$config['allow_overwrite']) {
@unlink($file['tmp_name']);
$errormsg = "$filename ".$lang['upload_error_fileexist'];
return;
}

$plikx = fopen(("opisy/".$filename.".opis"), w);
fwrite($plikx, $_POST['podpis']);
fclose($plikx);
$pliky = fopen(("opisy/".$filename.".pobran"), w);
fwrite($pliky, "0");
fclose($pliky);
$plikz = fopen(("opisy/".$filename.".ip"), w);
fwrite($plikz, $ipek);
fclose($plikz);

$filesource=$file['tmp_name'];
if (!file_exists($filesource)) {
$errormsg = "$filesource do no exist!";
return;
} else if (!move_uploaded_file($filesource,$filedest)) {
if (!rename($filesource,$filedest)) {
$errormsg = $lang['upload_error_nocopy'];
return;
}
}

if ($errormsg=="") {
chmod ($filedest, 0755);
if ($config['log_upload']) logadm($lang['UPLOAD'].' '.$filedest);
$loc = rooturl();
if (sizeof($dir)>0) $loc .= join("/",$dir)."/";
Header("Location: ".$loc);
exit;
}


Ten post edytował Tabus 24.03.2008, 14:03:14
Go to the top of the page
+Quote Post

Posty w temacie
- Tabus   + w nazwie pliku na uploadzie = Problem   22.03.2008, 17:33:54
- - wizu   Może przy uploadzie pliku zmieniaj nazwę pliku na ...   22.03.2008, 21:26:01
- - Tabus   no oczywiscie ze ja nie wzucam plików z + ale wzuc...   23.03.2008, 10:52:45
- - ebnott   zablokuj mozliwosc uploadowaniu plikow z "+...   23.03.2008, 15:25:03
- - Tabus   mógłbys podpowiedziać jak?? jestem w trakcie czyta...   23.03.2008, 18:16:57
- - vtuner   Po prostu, przy uploadowaniu przez system nadawaj ...   23.03.2008, 18:41:16
- - Tabus   Po prostu, przy uploadowaniu przez system nadawaj ...   23.03.2008, 19:38:31
- - wizu   O to mi chodziło... myślałem, że to będzie bardzie...   23.03.2008, 20:13:02
- - Tabus   nie jestem pewny czy to jest to. Kod//progressbar...   24.03.2008, 14:01:04
- - ebnott   Pomysł vtunera jest prawie dobry - pod warunkiem, ...   24.03.2008, 19:51:32
|- - vtuner   Cytat(ebnott @ 24.03.2008, 19:51:32 )...   24.03.2008, 21:43:44
- - Tabus   na uploadzie wzucamy pliki .zip i .rar da sie dla ...   24.03.2008, 20:00:47
- - ebnott   Kod$rozszerzenie = substr($file...   24.03.2008, 20:11:58
- - Tabus   zrobiłem tak jak napisałes działa ale po wzuceniu ...   24.03.2008, 20:45:38
- - ebnott   68901491c3a8f91fe20a52058128fe19.zip bo tak ma wys...   24.03.2008, 20:57:01
|- - ebnott   Cytat(ebnott @ 24.03.2008, 20:57:01 )...   25.03.2008, 18:25:13
- - Tabus   zmieniłem ale po wzuceniu pliku +++ ZIP.zip wyskak...   24.03.2008, 21:16:29
- - ebnott   w kodzie, ktory wkleiles nie ma ani jednej zmiany,...   24.03.2008, 21:21:43
- - Tabus   wkleiłem z normalnego bo musialem cos zle robic;/ ...   24.03.2008, 21:28:54
- - ebnott   tego nie usuwasz: if (isset($_POST['filen...   24.03.2008, 21:56:25
- - Tabus   zmienilem tak jak napisałes lecz teraz nie działa ...   24.03.2008, 22:02:55
- - ebnott   Juz miales wszystko podane na tacy. cało...   24.03.2008, 22:15:13
- - Tabus   zrobiłem jak napisałes ale teraz przy kazdej nazwi...   25.03.2008, 14:24:57
- - wlamywacz   Nie czytalem calego tematu ale ostatni post i tytu...   26.03.2008, 14:57:27
- - ebnott   Cytat(wlamywacz @ 26.03.2008, 14:57:2...   26.03.2008, 15:45:55


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 Aktualny czas: 5.10.2025 - 12:20