html - Having issues with PHP File Upload -
i trying upload file site odd reason not working. exists=true triggering means should working right? giving me $error=true;. below code:
html:
<input size="30" enctype="multipart/form-data" name="profile_icon" id="register-profile_icon" class="elgg-input-file" type="file">
php:
$profile_icon = $_files["profile_icon"]; if($profile_icon){ $exists=true; } $error = false; if(empty($profile_icon["name"])){ register_error(elgg_echo("profile_manager:register_pre_check:missing", array("profile_icon"))); $error = true; }
use $_files["profile_icon"]["tmp_path"]
file path.
$_files["profile_icon"]
contains arrays of values name, tmp_path, type, size etc.
on note need add enctype
attribute <form>
.
and there function available moving upload function move_uploaded_file();
Comments
Post a Comment