PHP File Handling: Dr. Jenila Livingston L.M. VIT Chennai
PHP File Handling: Dr. Jenila Livingston L.M. VIT Chennai
<?php
if (file_exists("abbr.txt"))
echo 'file exists';
else
echo 'filedoes not exist';
echo filesize("abbr.txt");
?>
Dr.L.M. Jenila Livingston 14
<?php Delete a file
if (file_exists("abbr.txt"))
echo 'file exists';
else
echo 'filedoes not exist';
echo filesize("abbr.txt");
unlink("abbr.txt");
if (file_exists("abbr.txt"))
echo 'not deleted';
else
echo 'got deleted';
?> Dr.L.M. Jenila Livingston 15
File Uploading
In your "php.ini" file, search for the file_uploads
directive, and set it to On:
file_uploads = On
move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file);
?>