osk Posted February 10, 2006 Report Share Posted February 10, 2006 Vai ir funkcija ar kuru var noteikt file extension? doc, zip, gif utt? Link to comment Share on other sites More sharing options...
osk Posted February 10, 2006 Author Report Share Posted February 10, 2006 Ja tas ir strrchr, tad laikam pats atradu Link to comment Share on other sites More sharing options...
Kavacky Posted February 10, 2006 Report Share Posted February 10, 2006 Explode ar . un skaties pēdējo elemetu. Link to comment Share on other sites More sharing options...
Tvinky Posted February 12, 2006 Report Share Posted February 12, 2006 Explode ar . un skaties pēdējo elemetu. A ja fails ir: "black.nigaz.photo.jpg.php" kas tad? ) Izmanto extension un parbaudi vēl uz strtolower - iespējams fails ir DoC vai jPg ))) Link to comment Share on other sites More sharing options...
bubu Posted February 12, 2006 Report Share Posted February 12, 2006 Tvinky: a ko tavuprāt Kavacky teiktajā nozīmēja vārdu salikums "skaties pēdējo elemetu." ? Link to comment Share on other sites More sharing options...
Delfins Posted February 12, 2006 Report Share Posted February 12, 2006 nu extension vien varen gļukaina lieta - katrs saliek visu ko vien vēlas... look deeper.. Link to comment Share on other sites More sharing options...
osk Posted February 13, 2006 Author Report Share Posted February 13, 2006 Piekrītu Delfīn, es to ņemu vērā, es pirms tam jau pārbaudu datu tipu. Bet par strtolower biju piemirsis, paldies ;o) Link to comment Share on other sites More sharing options...
Klez Posted February 13, 2006 Report Share Posted February 13, 2006 fails: fails.doc.zip.jPg.pNG apgriez stringu otraadi GNp.gPj. ... peec punkta sadali uz puseem njem pirmo masiiva elementu, paarvert visu uz mazajiem burtiem un pagriez stringu atpakalj ... ieguusi png :) fcija no manuaalja: http://lv.php.net/manual/en/function.strstr.php#51929 With regard to robbie and the post at "04-Mar-2005 04:52": if a filename contains more than one full stop, the two scripts below will fail in finding to correct file extension. The following code handles filenames like "document.about.ducks.doc" correctly. function findtype($file) { $revfile = strrev($file); $type = strtolower( strrev(substr($revfile,0,strpos($revfile,"."))) ); return $type; } Link to comment Share on other sites More sharing options...
osk Posted February 13, 2006 Author Report Share Posted February 13, 2006 Klez, šitas labs, pats tā ķīmiķot nebūtu aizdomājies... ;o) Link to comment Share on other sites More sharing options...
Delfins Posted February 13, 2006 Report Share Posted February 13, 2006 mueh, nav vienkāršāk? \.[a-z0-9]{1,3}$ Link to comment Share on other sites More sharing options...
Klez Posted February 14, 2006 Report Share Posted February 14, 2006 faila papalashinajums var buut .jpeg .flac .config .sh .c .h etc Link to comment Share on other sites More sharing options...
v3rb0 Posted February 14, 2006 Report Share Posted February 14, 2006 var arī nebūt vispār paplašinājums vai tikai paplašinājums, kā README un .htaccess Link to comment Share on other sites More sharing options...
hmnc Posted February 14, 2006 Report Share Posted February 14, 2006 gribētu redzēt kā uz servera jūzveri pludinātu .htaccess failus ;))) Link to comment Share on other sites More sharing options...
Recommended Posts