For very beginners to upload all types of images within with given maximum file size use the following code:
add code to ur interface like profile.php
<form action=”upload.php” method=”post” enctype=”multipart/form-data”>
<p>
<label for=”file”>Select an image file:</label> <input type=”file” name=”userfile” id=”file”> <br />
<button>Upload File</button>
<p>
</form>
Add code to upload.php:
<?
// Configuration – Your Options
$allowed_filetypes = array(‘.jpg’,’.gif’,’.bmp’,’.png’); // These will be the types of [...]
Filed under: PHP | Tagged: upload image | Leave a Comment »




