stencilz Posted May 23, 2007 Report Share Posted May 23, 2007 Kā lai pārbauda vai uploadētās bildes tips ir jpg respektīvi vai beigās ir tieši - jpg nevis JPG u.c? Link to comment Share on other sites More sharing options...
andrisp Posted May 23, 2007 Report Share Posted May 23, 2007 Ja vajag, ka tieši beigās ir "jpg", tad: $n = 'x.jpg'; if (substr($n, -3, 3) == 'jpg') { // ok } Link to comment Share on other sites More sharing options...
stencilz Posted May 23, 2007 Author Report Share Posted May 23, 2007 paldies, tas der Link to comment Share on other sites More sharing options...
Kavacky Posted May 24, 2007 Report Share Posted May 24, 2007 ir jpg respektīvi vai beigās ir tieši - jpg nevis JPG u.c?A man Paints seivo ar JPG galā. Vot stienis. Link to comment Share on other sites More sharing options...
neprasa Posted June 2, 2007 Report Share Posted June 2, 2007 vajag mime tipu parbaudit nevis pedejos 3 burtus ;) Link to comment Share on other sites More sharing options...
Neps Posted June 10, 2007 Report Share Posted June 10, 2007 vieglaak nav : <input type="file" name="jpgfile" accept="jpg"> Link to comment Share on other sites More sharing options...
Exzo Posted June 10, 2007 Report Share Posted June 10, 2007 Jebkurā gadījumā fails ir jāpārbauda servera pusē, jo " accept="image/jpeg" (MIME type!) der tikai godprātīgiem lietotājiem. Link to comment Share on other sites More sharing options...
GedroX Posted June 10, 2007 Report Share Posted June 10, 2007 Nepietiek arī uz servera pārbaudīt mime-type ideālā gadījumā. To vērtību sūta klients. Vai tad ne tā? Link to comment Share on other sites More sharing options...
Exzo Posted June 10, 2007 Report Share Posted June 10, 2007 (edited) mime-type var noteikt pēc faila paplašinājuma, kā to dara windoze (visai neuzticama padarīšana), gan paša faila mime_content_type() / finfo_file() Edited June 10, 2007 by Exzo Link to comment Share on other sites More sharing options...
Grey_Wolf Posted June 11, 2007 Report Share Posted June 11, 2007 mime-type --> tiek suutiits no klienta puses, un pat vienam failam atskjiraas atkariibaa no OSa & Barauzera.... Diezgan neuzticama padariishana... Bildeem ieteiktu parbaudiit / bildes/ augstumu un platumu pikseljos... tobish servera pusee atveert bildi..... Link to comment Share on other sites More sharing options...
andrisp Posted June 11, 2007 Report Share Posted June 11, 2007 http://lv2.php.net/manual/en/function.getimagesize.php ar šo lieliski var pārbaudīt vai augšupielādētais fails ir attēls vai nav. Link to comment Share on other sites More sharing options...
NiTrino Posted June 25, 2007 Report Share Posted June 25, 2007 aizmirstiet par mime-type uz visiem laikiem. Feikojas bez problēmām, pie tam dažādi browseri var padot dažādus mime-type. Kā piemēram IE6 bildi padod kā image/pjpeg a mozilla kā image/jpeg. Bildes pārbaudam ar getimagesize() kad fails ir uploadots un basta. Mūziku/video pārbaudām ar specialiem skriptiem (bij man kaut kur, vilka reālos datus no failiem un viegli sacīja, kas pa failiņu atnācis. Link to comment Share on other sites More sharing options...
andrisp Posted June 25, 2007 Report Share Posted June 25, 2007 NiTrino, kāda jēga topikam likt atbildē to, kas jau ir pateikts ? Vēl pietams vecam topikam. Link to comment Share on other sites More sharing options...
NiTrino Posted June 25, 2007 Report Share Posted June 25, 2007 NiTrino, kāda jēga topikam likt atbildē to, kas jau ir pateikts ? Vēl pietams vecam topikam. sorry... Link to comment Share on other sites More sharing options...
andrisp Posted June 25, 2007 Report Share Posted June 25, 2007 Nee, nu viss jau ir ok :) Link to comment Share on other sites More sharing options...
Recommended Posts