|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
file uploads
Hi,
I'm experiencing something very strange. I have a simple form, with this tag inside it: <input type="file" name="image" class="textfield" /> When the form is submitted I have a some php that checks that a file exists: if(strcmp('', $_FILES['image']['tmp_name'])) { do something(); } else { echo "no file there!"; } Is there any explicable reason why there wouldn't be any info in the global $_FILES array ?? I have exactly the same code on another script, in the same folder that works fine, really, I'm stumped! Thanks, Jon |
|
#2
|
|||
|
|||
|
Jon,
Have you verified your code? I'm not sure why you choose to check whether or not the file exists using the strcomp() function, but I have a feeling that it's not returning 1, so it's always going to execute the code in your else block. Have you tried echoing out the result produced by the string comparison function? Does it return 1, or does it return another number (0 or -1)? |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > file uploads |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|