Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> exif_imagetype sprawdzanie rodzaju pliku
-początkujący ;]-
post
Post #1





Goście







Jak sprawdzić czy plik jest plikiem JPG nie korzystając z funkcji exif_imagetype? na serwerze nie ma funkcji exif a nie chce żeby ktoś w formularzy gdzie można dodać zdjęcie wrzucał jakieś 'lewe' pliki których rozszerzenie jest jpg.
Go to the top of the page
+Quote Post
treewood
post
Post #2





Grupa: Zarejestrowani
Postów: 215
Pomógł: 0
Dołączył: 18.01.2003

Ostrzeżenie: (0%)
-----


Sproboj uzyc funkcji: getimagesize( ).
Jesli plik nie jest zdjeciem to zwroci FALSE


--------------------
Działam w OpenSolution.org, autor Quick.Cms i Quick.Cart już od ponad 10 lat
Go to the top of the page
+Quote Post
sf
post
Post #3





Grupa: Zarejestrowani
Postów: 1 597
Pomógł: 30
Dołączył: 19.02.2003
Skąd: Tychy

Ostrzeżenie: (0%)
-----


"$_FILES['userfile']['type']

The mime type of the file, if the browser provided this information. An example would be "image/gif". This mime type is however not checked on the php side and therefore don't take its value for granted. "


--------------------
Zapraszam na mój php blog, tworzenie stron.
Go to the top of the page
+Quote Post
-Guest-
post
Post #4





Goście







Cytat(sf @ 2005-10-01 14:20:52)
"$_FILES['userfile']['type']

The mime type of the file, if the browser provided this information. An example would be "image/gif". This mime type is however not checked on the php side and therefore don't take its value for granted. "

też tak kombinowałem. sprawdzałem czy typ to image/jpg lub image/pjgp. sam nie mogłem w to uwierzyć ale gdy otworzysz sobie notatnik (albo cokolwiek innego), zapiszesz pusty plik jako *.jpg to $_FILES['userfile']['type'] pokaże Ci że masz do czynienia z image/jpg... :/
Go to the top of the page
+Quote Post
sf
post
Post #5





Grupa: Zarejestrowani
Postów: 1 597
Pomógł: 30
Dołączył: 19.02.2003
Skąd: Tychy

Ostrzeżenie: (0%)
-----


To dodatkowo sprawdz funckja przedstawiona przez treewooda smile.gif


--------------------
Zapraszam na mój php blog, tworzenie stron.
Go to the top of the page
+Quote Post
mike
post
Post #6





Grupa: Przyjaciele php.pl
Postów: 7 494
Pomógł: 302
Dołączył: 31.03.2004

Ostrzeżenie: (0%)
-----


A może mime_content_type() :?:
W końcu do tego została stworzona.
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 20.08.2025 - 11:27