Return to Snippet

Revision: 25220
at March 23, 2010 16:44 by bradless


Initial Code
// $_FILES array
// $_FILES['field_name']['name'] = filename
// $_FILES['field_name']['type'] = mime type, if provided by browser
// $_FILES['field_name']['size'] = file size in bytes
// $_FILES['field_name']['tmp_name'] = temp file name / location
// $_FILES['field_name']['error'] = error code

if(is_uploaded_file($_FILES['field_name']['tmp_name'])) {
   $file = file_get_contents($_FILES['field_name']['tmp_name']);
   // do something with $file
}

Initial URL

                                

Initial Description

                                

Initial Title
uploaded file handling with php

Initial Tags
php, file

Initial Language
PHP