Page 1 of 1

[SOLVED] uploaded files

Posted: Fri Aug 27, 2004 11:13 pm
by ol4pr0
Oke.. here it is.

upload should work, it worked before. ( if i access the page directly is works aswell. )

However i have included the page.

all form field values are being returned with print_r, so nothing wrong there.
uploaded files is going badly.

Code: Select all

print_r ($_FILES['foto']);
#returned
Array ( [name] => book.png [type] => image/png [tmp_name] => C:\WINNT\TEMP\php1D.tmp [error] => 0 [size] => 4407 )
However the following code says otherwise

Code: Select all

#before i had $HTTP_POST_FILES instead of whats below
#thought maby it had something to do with that.

	if (isset($_HTTP_POST_FILES['curriculum']['name'])) $file_name2 = $_HTTP_POST_FILES['curriculum']['name'];
		else $file_name2 = "";
	if (isset($_HTTP_POST_FILES['curriculum']['size'])) $file_size2 = $_HTTP_POST_FILES['curriculum']['size'];
		else $file_size2 = "";
	if (isset($_HTTP_POST_FILES['curriculum']['tmp_name'])) $file_tmp2 = $_HTTP_POST_FILES['curriculum']['tmp_name'];
		else $file_tmp2 = "";
	
	if (isset($_HTTP_POST_FILES['foto']['name'])) $file_name = $_HTTP_POST_FILES['foto']['name'];
		else $file_name = "";
	if (isset($_HTTP_POST_FILES['foto']['size'])) $file_size = $_HTTP_POST_FILES['foto']['size'];
		else $file_size = "";
	if (isset($_HTTP_POST_FILES['foto']['tmp_name'])) $file_tmp = $_HTTP_POST_FILES['foto']['tmp_name'];
		else $file_tmp = "";
		
	
	#fotito
	if (($file_name == "")||($file_size == "")||($file_tmp == "")) {
	echo '¿ El fotito ?<br>';
	}
	#Hoja de Vida
	if (($file_name2 == "")||($file_size2 == "")||($file_tmp2 == "")) {
	echo '<br>¿Olvidaste El Curriculum?<br>';
	}
#being returned on screen.
¿El fotito?

¿El Curriculum?

Posted: Fri Aug 27, 2004 11:20 pm
by ol4pr0
I figured it out..

using

Code: Select all

$_FILES['curriculum']['name']
However understanding it i do not.

Posted: Fri Aug 27, 2004 11:23 pm
by feyd
$HTTP_POST_FILES is the correct OLD form.. $_FILES is the correct NEW form.