views:

225

answers:

4

how do i get the php to reconize that there is a file being uploaded to it by the vb webclient

current php code is this

if(count($_FILES)==1) {
    //move_uploaded_file  
    ( $_FILES[0]["tmp_name"]  , "./imgs/curdesktop.png"  );

    file_put_contents("./nin.txt",print_r($_FILES));
}

all it does right now is check the FILE array and supposed to print the attributes out into a text file. however the vb program says that the file is uploaded with no errors and the $_FILES array returns 1 which is invalid for that array

A: 

You have print_r() as a function which returns a value. Check first wat print_r really prints on the screen. (I think it does print it now already)

Peter Smit
A: 

Try using var_export():

file_put_contents("./nin.txt",var_export($_FILES,true));

Passing true as the second argument will return the variable representation instead of outputing it, so the contents should write to the file.

karim79
A: 

Make that print_r($_FILES, true).

Zahymaka
A: 

Its working thanks

Jim