|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
File Upload / File type
I am writing a file upload script. before I write the file I only want to write it if it is a jpg.
So I wrote this line $check_extention = explode(".", $image_upload_name); if I echo ($check_extention[1] it shows jpg. now in the following line it does not work. if ($check_extention[1] == "jpg") { $write_image = "ok"; } Now if I echo $write_image it is empty. so it does not write as I directed it to do. Any clue to what I am doing wrong. |
|
#2
|
|||
|
|||
|
RE: File Upload / File type
|
|
#3
|
|||
|
|||
|
RE: File Upload / File type
why done you just use this??/
if($image_upload_type != "image/jpeg") //dont upload! |
|
#4
|
|||
|
|||
|
RE: RE: File Upload / File type
I'm taking it a little bit futher:
|
|
#5
|
|||
|
|||
|
RE: File Upload / File type
|
|
#6
|
|||
|
|||
|
RE: File Upload / File type
yes, but as with any client-side thing - that can be bypassed. Client-Side stuff is great for making wizzy effects/design/doing a primary check of forms, but you can't trust anything your script is given from a form - you have to check it with your server-side script to make sure it is valid.
|
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > File Upload / File type |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|