created two files: “index.html” and “upload.php”.
The “index.html” contains a form for sending files as shown below:
Send this file:
-------------------------------------------------------------------------------------
The contents of the file "upload.php" is shown below:
-------------------------------------------------------------------------------------
<?php
$uploaddir = 'C:\Users\UserName\Documents\uploads\';
$uploadfile = $uploaddir.$_FILES['userfile']['name'];
print ""; if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploaddir . $_FILES['userfile']['name'])) { print "The file is valid and do run with success!"; print_r($_FILES); } else { print "Error!"; print_r($_FILES); } print ""; ?> ------------------------------------------------------------------------------------- I changed the following fields in the php configuration file called "php.ini": ------------------------------------------------------------------------------------- max_execution_time=60000000000
max_input_time=60000000000
memory_limit=1024M
post_max_size=1024M
upload_max_filesize=1024M
I did it so I could upload files up to 1GB.
However, when performing the procedure for sending files by the browser, the file “upload.php” returns the following error messages:
Parse error: syntax error, unexpected ‘userfile’ (T_STRING) in C:\Users\UserName\Documents\scripts\upload.php on line 7
What do to do upload files?