What are the potential pitfalls of not setting the enctype attribute in a form for file uploads in PHP?
If the enctype attribute is not set in a form for file uploads in PHP, the uploaded file data will not be properly encoded and sent to the server. This can result in the file being corrupted or not uploaded at all. To fix this issue, you should set the enctype attribute to "multipart/form-data" in the form tag.
<form action="upload.php" method="post" enctype="multipart/form-data">
<input type="file" name="file">
<input type="submit" value="Upload">
</form>