you can do it using html upload form:
<form action='script.php' method=POST enctype='multipart/form-data'>
<INPUT TYPE='hidden' name='MAX_FILE_SIZE' value='200000'>
File:<input name='a_file' type='file'><br>
<input type='submit' value='Send'>
</form>
well.. that form will show a 'browse' button at your page.. clicking it, you can choise any file on your local system.
sending that form, it will be stored in a temp folder..
the max_file_size parameter needs to be observed.. if you send a file greater than it, you get an error.
at 'script.php' you need to copy (and maybe rename) the file to a secure folder..
associated with 'a_file' form, there is some variables:
$arquivo_name - the name of the sended file
$arquivo_size - size in bytes
$arquivo_type - file's MIME, from browser..
if any file is sended, the variable '$a_file' is 'none'
if ($a_file != "none") { copy($a_file, "folder/newname"); }
- if your server system is winblows, take care with / or \
- you dont needs to del the file at temp folder. it occours atomaticaly.
- the maxfile parameter is also seted at your httpd server.. at some ini file.. i can't help you more at this topic cause i never do it.. i only knows that exists.
ic