File Uploading-using PHP

By | January 18, 2014

Below code will do the fileuploading.

we have to add the below function into the fileupload.php

bool move_uploaded_file ( string $filename , string $destination );

Fileupload.php

if you want store other information related to that particular file just use the following supergloabal array

$_FILES[‘file’][‘tmp_name’]- the uploaded file in the temporary directory on the web server.

$_FILES[‘file’][‘name’] – the actual name of the uploaded file.

$_FILES[‘file’][‘size’] – the size in bytes of the uploaded file.

$_FILES[‘file’][‘type’] – the MIME type of the uploaded file.

$_FILES[‘file’][‘error’] – the error code associated with this file upload.

Note:Temporary directory name for storing files and size of the files are setting using php.ini

upload_tmp_dir
upload_max_filesize