millers Posted April 9, 2008 Report Share Posted April 9, 2008 Sveicinat visi veletos dabuti kadu script vai ari sagaidiit palidzibu no jums man vajaga upload skripu kas saglabaa failu ar nosaukumu bilde_ un aiz bilde_gadsmenesisdiena piemeram bilde_2008-04-04 kkas tads un ja tas fails piemeram existe ar tadu nosaukumu lai automatiski saglabaa pa virsu... thx jau ieprieks ja vajaga varu piemest kkadu upload script http://paste.php.lv/7152 Link to comment Share on other sites More sharing options...
andrisp Posted April 10, 2008 Report Share Posted April 10, 2008 $filename = 'bilde_' . date('Y-m-d').'.'.$ext PS. Un gramatikas ziņā atkal kārtējais "Nošaut nevajag apžēlot" vairants. Link to comment Share on other sites More sharing options...
millers Posted April 10, 2008 Author Report Share Posted April 10, 2008 a vari bisku palidzet vari to code kuru iedevu apvienot ar tavejo ? jo man php vell ta kartigi neiet ;) Link to comment Share on other sites More sharing options...
Faks Posted April 10, 2008 Report Share Posted April 10, 2008 (edited) tani kur tu echo ara vajag pievienot <? echo $filename = 'bilde_' . date('Y-m-d').'.'.$ext ?> vai ari var <? print $filename = 'bilde_' . date('Y-m-d').'.'.$ext?> var ari ar print un printf :) ! tiesak tani faila kur teu indes ir kur vajag ara dabut tur sitas jaliek :) parbaudi jo man nau vis scripts lai varetu parbaudit :) ! Edited April 10, 2008 by Faks Link to comment Share on other sites More sharing options...
andrisp Posted April 10, 2008 Report Share Posted April 10, 2008 Faks, ko var dot bezjēdzigus padomus, autoram vajag uploadošanas skriptu. Nemaz neizlasi, ko autors vispār prasa pirms atbildi ? millers, to $filename padod move_uploaded_file() funkcijai kā otro parametru. Paplašinājumu vari dabūt: 1) Ar strrpos() nosaki, kur ir pēdējais punkts. Ar strlen() nosaki kopējo garumu faila nosaukumam. 2) Ar substr() dabū ārā gan faila nosaukumu bez paplašinājumu, gan pašu paplašinājumu. Ceru, ka spēsi izdomāt, kā izmantot šīs fukncijas. Link to comment Share on other sites More sharing options...
millers Posted April 10, 2008 Author Report Share Posted April 10, 2008 viss kko izmeiginaju nekas nesanaa. vari ludzu manu to script apvienot ar savu ideju ? http://paste.php.lv/7152 Link to comment Share on other sites More sharing options...
maka Posted April 10, 2008 Report Share Posted April 10, 2008 $filename = $_FILES['file']['tmp_name']; $ext = substr($filename,strrpos($filename, '.')+1,strlen($filename)); $filename = 'bilde_' . date('Y-m-d').'.'.$ext; move_uploaded_file($_FILES["file"]["tmp_name"],"../mape/" . $filename); Link to comment Share on other sites More sharing options...
Recommended Posts