ohmygod Posted March 12, 2005 Report Share Posted March 12, 2005 Nesaprotu, kas iisti par vainu. Ir skripts, kas pievienojot rakstu ljauj arii tam pievienot bildi. Maajaas uz mana testu servaka viss darbojas, nav nemazaako probleemu, bet uz serveris.lv servaka man bilde tjip uploadojas, FTP raada, ka ir vinja tur, bet nekas vinju neatteelo. Noraadot tiehu celju uz to browseris izmet erroru, ka nav faila tur. Taa notiekaas ar visiem browseriem. Nezin cik reizhu paalriecinaajos par celju pareiziibu. NU ir viss kedaa! if(file_exists($file)){} atgriezh pozitiivu rezultaatu - tjip ka fails ir, bet ar tiehi taadu pashu URL bilde valjaa neveras. Vienkaarshi tukshs laukums. Izmeeru uzraada normaalu! Kur vareetu buut probleema? dirai CHMOD 777, visi jaunie faili paraadaas... Link to comment Share on other sites More sharing options...
kirils Posted March 12, 2005 Report Share Posted March 12, 2005 browseris izmet rroru, ka nav faila tur. 14952[/snapback] esi paarliecinaats, ka errors ir 404, nevis 403? taadaa gadijumaa, Tu esi sajaucis vietu, kur uploadot, un reaali vinja tiek uzkachaata kur citur. Link to comment Share on other sites More sharing options...
ohmygod Posted March 12, 2005 Author Report Share Posted March 12, 2005 (edited) bilde paraadas pareizajaa vietaa. Seezhu jau kaadu pusotru stundu un pa FTP sekoju liidzi, kas un kaa notiekaas. FTP redzu, ka fails ir vietaa, bet vinjsh vienkaarshi - tjip kaa tukshs buutu. Pemeegjinaaju uz cita servaka veel - tur viss darbojas. Nevar gadiities, ka tur kkas no serva konfiga? Errors ir 403: Forbidden You don't have permission to access /rakstiem/img/Baiba_sm.jpg on this server. sorrz, bik ne taa izteicos... reaali - pa FTP izdzeeshot failu un paarlaadeejot pa jaunu tieshi tajaa pashaa vietaa - viss ir kedaas... :/ Edited March 12, 2005 by ohmygod Link to comment Share on other sites More sharing options...
blackhalt Posted March 12, 2005 Report Share Posted March 12, 2005 Vecs u neoptimizēts, bet darbojās: <?php // bildes echo"<form enctype=\"multipart/form-data\" action=\"bildes.php?action=done\" method=\"post\">"; //upload process echo'<br/>Panjemt bildi:<br /><input type="file" name="file" /><br />'; if(isset($file)){ // K|NG uploaders $liktne='/home/virtual/***/fst/var/www/html/bildes';// tava direktorija $f_nos='file'; if(substr($liktne,-1)!='/'){ $liktne.='/'; } if(!is_dir($liktne)){ die("<b>$liktne</b> nav pareiza direktorija<br /><a href=\"bildes.php\">Iet atpakalj</a>"); } $kurlikt=$liktne.$_FILES[$f_nos]['name']; $lol=$_FILES[$f_nos]['name']; if(empty($_FILES[$f_nos]['name'])){ @unlink($_FILES[$f_nos]['tmp_name']);// die("A taa nevar! <a href=\"bildes.php\">Iet atpakalj</a>"); } if(file_exists($kurlikt)){ @unlink($_FILES[$f_nos]['tmp_name']);// die("Nevar, jo fails $lol jau ir! <a href=\"bildes.php\">Iet atpakalj</a>"); } move_uploaded_file($_FILES[$f_nos]['tmp_name'],$kurlikt); @unlink($_FILES[$f_nos]['tmp_name']);// // celjsh : $file="/home/virtual/***/fst/var/www/html/bildes/$lol"; $file2="/home/virtual/***/fst/var/www/html/bildes/m_$lol"; if(!copy($file,$file2)) { die("nevaru nokopeet $file...\n"); } chmod($file,0644); chmod($file2,0644); $bilde="$file2"; function resize_jpg($img,$w,$h) { $thumb=imagecreatetruecolor($w, $h); $image=ImageCreateFromJpeg($img); $imagedata=getimagesize($img); imagecopyresized($thumb, $image, 0, 0, 0, 0, $w, $h, $imagedata[0], $imagedata[1]); imagejpeg($thumb, $img, 100); echo'Mazā bilde ir gatava!'; } // JPG function resize_png($img,$w,$h) { $thumb=imagecreatetruecolor ($w, $h); $image=ImageCreateFromPng($img); $imagedata=getimagesize($img); imagecopyresized($thumb, $image, 0, 0, 0, 0, $w, $h, $imagedata[0], $imagedata[1]); imagepng($thumb, $img); echo'Mazā bilde ir gatava!'; } // PNG $size=getimagesize ($bilde); $a=$size[0]/4; $b=$size[1]/4; $z=$size[2]; if($z=='2'){ resize_jpg($bilde,$a,$b); } if($z=='3'){ resize_png($bilde,$a,$b); } } switch($action){ case'done':{ echo'<br /><b>Lielā bilde gatava!</b> '; echo"<a href=\"../bildes/$lol\"><img src=\"../bildes/m_$lol\" alt=\"\" /></a><br />"; break; } default:{ }} echo'<br /> <input type="submit" name="Submit" value=" Akceptēt " /> </form><hr />'; // eof ?> Link to comment Share on other sites More sharing options...
kirils Posted March 12, 2005 Report Share Posted March 12, 2005 blackhalt: paste.php; ohmygod: nu tak taa arii vajag teikt, ka nav tiesiibu, nevis, ka failam nevar piekljuut :P [gribas lamaaties]. ja nav tiesiibu, tad failam uzreiz peec upload vaig chmodu uztaisiit. Link to comment Share on other sites More sharing options...
ohmygod Posted March 12, 2005 Author Report Share Posted March 12, 2005 ohmygod: nu tak taa arii vajag teikt, ka nav tiesiibu, nevis, ka failam nevar piekljuut :P [gribas lamaaties]. ja nav tiesiibu, tad failam uzreiz peec upload vaig chmodu uztaisiit. 14960[/snapback] Ehh, man tev gruuti izskaidrot... Vinjsh taa raada, jo to failu vispaar neatrod un direktorijai tiesiibu piekljuut nav! gribi teikt, ka PHP, lai ar <img tagu es paraadiitu bildi, man vaijag veel tiesiibas likt vinju paraadiit? Vienkaarshi ar FTP iekopeejot, nekaadas tiesiibas nekur neliekot tachu straadaa! Uploadojot ar PHP - fails ir tukshs! Novelkot jamo no serva (tur, kur uploadoju) - atveert var tikai ar grafiskajiem redaktoriem un ACDsee. IE, FF u.t.t jamaas neatteelo! Vienkaarshi tukshums! A izmeers normaals... Link to comment Share on other sites More sharing options...
bubu Posted March 13, 2005 Report Share Posted March 13, 2005 Novelc to savu dīvaini uploadoto failu, un ieliec publiskai apskatei. Vai arī iedod linku pa taisno uz to. Link to comment Share on other sites More sharing options...
kirils Posted March 13, 2005 Report Share Posted March 13, 2005 chmods nepaliidzeeja? Link to comment Share on other sites More sharing options...
Recommended Posts