How To Upload File Using Php November 30, 2022 Post a Comment plz help me I dont know how to make this work Your Photo: Solution 1: Can u try it? $path = $_FILES['file']['name']; if (file_exists($path)) { echo 'File already exists!'; } else { move_uploaded_file($_FILES['file']['tmp_name'], $path); } Copy Solution 2: I think you are missing something like this: move_uploaded_file($_FILES["file"]["tmp_name"], "../img/profiles/" . $_FILES["file"]["name"]); echo "Stored in: " . "../img/profiles/" . $_FILES["file"]["name"]; Copy Solution 3: use move_uploaded_file(file,location) you need to change your file field name to file instead photo <input type="file" name="file" size="25" /> Copy if don't change than use code like below to upload it. move_uploaded_file($_FILES["photo"]["tmp_name"], "location/to/save/photo/with/extension"); Copy Solution 4: <input type="file" name="photo" size="25" /> Copy should be like <input type="file" name="file" size="25" /> Copy because you are looking for $_FILES["file"] not $_FILES["photo"]; make change to either your input name or the $_FILE[] as you wish. Share Post a Comment for "How To Upload File Using Php"
Post a Comment for "How To Upload File Using Php"