logo

Extra Block Types (EBT) - New Layout Builder experience❗

Extra Block Types (EBT) - styled, customizable block types: Slideshows, Tabs, Cards, Accordions and many others. Built-in settings for background, DOM Box, javascript plugins. Experience the future of layout building today.

Demo EBT modules Download EBT modules

❗Extra Paragraph Types (EPT) - New Paragraphs experience

Extra Paragraph Types (EPT) - analogical paragraph based set of modules.

Demo EPT modules Download EPT modules

Scroll
22/02/2025, by Anonymous (not verified)

Please tell me, where should I place the file upload.php in the directory so that the upload form points to this file? Please advise, as my diploma is at stake. (website address localhost/drupal)

Form code (upload.html)
<html>
<head>
<title>File Upload to Server</title>
</head>
<body>
<h2><p><b> File Upload Form </b></p></h2>
<form action="upload.php" method="post" enctype="multipart/form-data">
<input type="file" name="filename"><br>
<input type="submit" value="Upload"><br>
</form>
</body>
</html>

Script for processing the form (upload.php)
<html>
<head>
<title>File Upload Result</title>
</head>
<body>
<?php
if($_FILES["filename"]["size"] > 1024*3*1024)
{
echo ("The file size exceeds three megabytes");
exit;
}
// Check if the file has been uploaded
if(is_uploaded_file($_FILES["filename"]["tmp_name"]))
{
// If the file is uploaded successfully, move it
// from the temporary directory to the final destination
move_uploaded_file($_FILES["filename"]["tmp_name"], "/path/to/file/".$_FILES["filename"]["name"]);
} else {
echo("File upload error");
}
?>
</body>
</html>