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%)
-----


zrobiłem jak napisałes ale teraz przy kazdej nazwie pliku znowy wyskakuje ten dziwny kod ;/
podaje link żeby było widać jak to wygląda

http://upload-triosat.pl/

podaje kod

  1. <?php
  2. //progressbar upload
  3. if ($config['upload_progressbar']){
  4. if (isset($_GET['sid'])) {
  5. $sid = $_GET['sid'];
  6. $tmp_dir = $config['upload_tmpdir'];
  7. $sid = ereg_replace("[^a-zA-Z0-9]","",$sid);//clean sid
  8. $file = $tmp_dir.'/'.$sid.'_qstring';
  9. if(!file_exists($file)) {
  10. $errormsg = $lang['upload_error_sid'];
  11. } else {
  12. $qstr = join("",file($file));
  13. //parse_str($qstr);
  14. parse_str($qstr, $_POST);
  15.  
  16. //cleaning shit
  17. $exts = array("_flength","_postdata","_err","_signal","_qstring");
  18. foreach($exts as $ext) {
  19. if(file_exists("$tmp_dir/$sid$ext")) {
  20. @unlink("$tmp_dir/$sid$ext");
  21. }
  22. }
  23.  
  24. //setting vars like without progressbar
  25. $_FILES['file']['name']=basename($_POST['file']['name']['0']);
  26. $_FILES['file']['size']=$_POST['file']['size']['0'];
  27. $_FILES['file']['tmp_name']=$_POST['file']['tmp_name']['0'];
  28. }
  29. } else if (isset($_POST['errormsg'])) {
  30. $errormsg = urldecode($_POST['errormsg']);
  31. if ($errormsg =="The maximum upload size has been exceeded")
  32. $errormsg = $lang['upload_error_sizelimit'].' ('.getfilesize($max_filesize).').';
  33. }
  34. }
  35.  
  36. //uploading
  37. if (isset($_FILES['file'])) {
  38. if ($config['protect_upload']) authorize();
  39. uploadfile($_FILES['file'], $_SERVER["REMOTE_ADDR"]);
  40. }
  41.  
  42. if (isset($zbanujxD)) {
  43. authorize();
  44. $uah = fopen('zabanowani.txt', 'a+');
  45. fwrite($uah, $zbanujxD.' ');
  46. fclose($uah);
  47. kierowca();
  48. }
  49.  
  50. function kierowca(){
  51. header('Location:'.rooturl());
  52. return;
  53. }
  54.  
  55. function uploadfile($file, $ipek) {
  56. global $config, $lang, $max_filesize, $errormsg,$dir;
  57.  
  58. if ($file['error']!=0) {
  59. $errormsg = $lang['upload_error'][$file['error']];
  60. return;
  61. }
  62.  
  63. //determine filename
  64. $filename=$file['name'];
  65. if (isset($_POST['filename']) && $_POST['filename']!="") $filename=$_POST['filename'];
  66. $nazwa = $file['name'];
  67. $nazwa= str_replace("+", "_", $nazwa);
  68. $rozszerzenie = substr($file['name'], -4,4);
  69. $nazwa2 = md5($file['name'].time());$filename = $nazwa."_".$nazwa2.$rozszerzenie;
  70. if (isset($_POST['filename']) &&  $_POST['filename']!="") {$nazwa = $_POST['filename'];
  71. $nazwa= str_replace("+", "_", $nazwa);
  72. $rozszerzenie = substr($_POST['filename'], -4,4);
  73. $nazwa2 = md5($_POST['filename'].time());
  74. $filename = $nazwa."_".$nazwa2.$rozszerzenie;}
  75. $filename=basename($filename);
  76. $filename=explode(".",basename($filename));
  77. $ext = $filename[count($filename)-1];
  78. unset($filename[count($filename)-1]);
  79. $filename=join('_',$filename).'.'.$ext;
  80.  
  81. if (!in_array(strtolower(extname($filename)), $config['allowed_ext'])) {
  82. $errormsg = $lang['upload_badext'];
  83. return;
  84. }
  85.  
  86. $filesize=$file['size'];
  87. if ($filesize > $max_filesize) {
  88. @unlink($file['tmp_name']);
  89. $errormsg = $lang['upload_error_sizelimit'].' ('.getfilesize($max_filesize).').';
  90. return;
  91. }
  92.  
  93. $filedest = $config['storage_path'].'/'.$filename;
  94. if (file_exists($filedest) && !$config['allow_overwrite']) {
  95. @unlink($file['tmp_name']);
  96. $errormsg = "$filename ".$lang['upload_error_fileexist'];
  97. return;
  98. }
  99.  
  100. $plikx = fopen(("opisy/".$filename.".opis"), w);
  101. fwrite($plikx, $_POST['podpis']);
  102. fclose($plikx);
  103. $pliky = fopen(("opisy/".$filename.".pobran"), w);
  104. fwrite($pliky, "0");
  105. fclose($pliky);
  106. $plikz = fopen(("opisy/".$filename.".ip"), w);
  107. fwrite($plikz, $ipek);
  108. fclose($plikz);
  109.  
  110. $filesource=$file['tmp_name'];
  111. if (!file_exists($filesource)) {
  112. $errormsg = "$filesource do no exist!";
  113. return;
  114. } else if (!move_uploaded_file($filesource,$filedest)) {
  115. if (!rename($filesource,$filedest)) {
  116. $errormsg = $lang['upload_error_nocopy'];
  117. return;
  118. }
  119. }
  120.  
  121. if ($errormsg=="") {
  122. chmod ($filedest, 0755);
  123. if ($config['log_upload']) logadm($lang['UPLOAD'].' '.$filedest);
  124. $loc = rooturl();
  125. if (sizeof($dir)>0) $loc .= join("/",$dir)."/";
  126. Header("Location: ".$loc);
  127. }
  128. }
  129.  
  130. //make dir
  131. if (isset ($_POST['dir'])) {
  132. if ($config['protect_makedir']) authorize();
  133. if ($dirlevel < $config['enable_folder_maxdepth']) {
  134. $newdir = preg_replace("/[^0-9a-zA-Z()s]/i",'', $_POST['dir']);
  135. if ($newdir <> "") {
  136. $newdir = $config['storage_path']."/".$newdir;
  137. if (file_exists($newdir))
  138. $errormsg = $lang['make_error_exist'];
  139. else {
  140. if (mkdir($newdir)) {
  141. $loc = rooturl();
  142. if (sizeof($dir)>0) $loc .= join("/",$dir)."/";
  143. Header("Location: ".$loc);
  144. } else
  145. $errormsg = $lang['make_error_cant'];
  146. }
  147. }
  148. } else {
  149. $errormsg = $lang['make_error_maxdepth'];
  150. }
  151. }
  152.  
  153. $szukaj1;
  154.  
  155. if (isset ($_POST['szukaj2'])) {
  156. $szukaj1 = $_POST['szukaj2'];
  157. }
  158.  
  159. if(isset($edit1)){
  160. authorize();
  161. echo '<form method="post" action="index.php">
  162. <input id=" " type="submit" value="Powrot" />
  163. </form>';
  164. echo '<form method="post" action="index.php?edit21='.$edit1.'"><br>';
  165. echo 'Nazwa : ';
  166. echo '<input type="text" id="enazwa" name="enazwa" value="'.$edit1.'" size="50" /><br>Opis : ';
  167. $podpis = file_get_contents("opisy/".$edit1.".opis");
  168. echo '&nbsp &nbsp<input type="text" id="eopis" name="eopis" value="'.$podpis.'" size="50" />';
  169. echo '<input id="edycja" type="submit" value="Zatwierdz" />';
  170. }
  171. ?>


coś jeszcze źle zrobiłem?

jak myslisz co zrobic??
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
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 15.10.2025 - 18:12