Jump to:
Screenshot
Attributes
Files
<?php
$target_dir = "/avatars/";
$target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);
if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) {
echo "The file " . htmlspecialchars(basename($_FILES["fileToUpload"]["name"])) . " has been uploaded.";
} else {
echo "Sorry, there was an error uploading your file.";
}
Version: 3.1.0beta2
File format: 4
TRACE START [2023-02-12 23:07:58.049444]
1 0 1 0.000153 393464
1 3 0 0.000215 396080 {main} 1 /var/www/html/uploads/up.php 0 0
1 A /var/www/html/uploads/up.php 3 $target_dir = '/avatars/'
2 4 0 0.000262 396080 basename 0 /var/www/html/uploads/up.php 4 1 NULL
2 4 1 0.000276 396144
2 4 R ''
1 A /var/www/html/uploads/up.php 4 $target_file = '/avatars/'
2 5 0 0.000306 396080 move_uploaded_file 0 /var/www/html/uploads/up.php 6 2 NULL '/avatars/'
2 5 1 0.000321 396152
2 5 R FALSE
1 3 1 0.000335 396080
0.000360 314320
TRACE END [2023-02-12 23:07:58.049681]
<html><head></head><body>Sorry, there was an error uploading your file.</body></html>
<?php
$target_dir = "/avatars/";
$target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);
if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) {
echo "The file ". htmlspecialchars( basename( $_FILES["fileToUpload"]["name"])). " has been uploaded.";
} else {
echo "Sorry, there was an error uploading your file.";
}
?>