Search the Community
Showing results for tags 'upload files'.
-
Hello I am using the code: <?php if ($_FILES["file"]["error"] > 0) { echo "Error: " . $_FILES["file"]["error"] . "<br>"; } else { echo "Upload: " . $_FILES["file"]["name"] . "<br>"; echo "Type: " . $_FILES["file"]["type"] . "<br>"; echo "Size: " . ($_FILES["file"]["size"] / 1024) . " kB<br>"; echo "Stored in: " . $_FILES["file"]["tmp_name"]; } if ( ($_FILES["file"]["size"] < 25000) ) { if ($_FILES["file"]["error"] > 0) { echo "Error: " . $_FILES["file"]["error"] . "<br>"; } else { echo "Upload: " . $_FILES["file"]["name"] . "<br>"; echo "Type: " . $_FILES["file"]["type"] . "<br>"; echo "Size: " . ($_FILES["file"]["size"] / 1024) . " kB<br>"; echo "Stored in: " . $_FILES["file"]["tmp_name"]; } } else { echo "Invalid file"; } echo "<br>".'2'."<br>"; if (($_FILES["file"]["size"] < 25000) ) { if ($_FILES["file"]["error"] > 0) { echo "Return Code: " . $_FILES["file"]["error"] . "<br>"; } else { echo "Upload: " . $_FILES["file"]["name"] . "<br>"; echo "Type: " . $_FILES["file"]["type"] . "<br>"; echo "Size: " . ($_FILES["file"]["size"] / 1024) . " kB<br>"; echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br>"; if (file_exists("upload/" . $_FILES["file"]["name"])) { echo $_FILES["file"]["name"] . " already exists. "; } else { $success= move_uploaded_file($_FILES["file"]["tmp_name"], $_FILES["file"]["name"]); if($success){ echo "success Stored in: " . $_FILES["file"]["name"]; } } } } else { echo "Invalid file"; } ?> This is properly working on my local host but not working on the server which I am using this line $success= move_uploaded_file($_FILES["file"]["tmp_name"], $_FILES["file"]["name"]); is not working kindly help me thanks
- 2 replies
-
- upload files
- php
-
(and 1 more)
Tagged with: