I have one more question. I want to know that how can I limit the upload to JPG file only. I got this code in reply of my message.
I want that the user can only upload JPG files only and not other files.
[CODE]
<?php
$fileatt = $_FILES[‘fileatt’][‘tmp_name’];
$fileatt_type = $_FILES[‘fileatt’][‘type’];
$fileatt_name = $_FILES[‘fileatt’][‘name’];
$uploads_directory = ‘/some/directory/’; // fill this in…
$upload_dir_and_filename = $uploads_directory . $fileatt_name;
if (is_uploaded_file($fileatt)) {
if ( move_uploaded_file($fileatt, $upload_dir_and_filename)) {
echo “success!”;
}else{
echo “fail!”;
}
}else{
echo “no file uploaded!”;
}
?>