Cory94bailly Posted May 23, 2008 Share Posted May 23, 2008 I know it's possible but I'm having lots of problems.. Recent.php: <title>Add/Delete Recent Configs/Work</title> <a href="../">Home</a> <form action="upload.php" method="post" enctype="multipart/form-data"> <label for="file">Filename:</label> <input type="file" name="file" id="file" /> <br /> <input type="submit" name="submit" value="Submit" /> </form> </form> Upload.php: <?php if ($_FILES["file"]["error"] > 0) { echo "Return Code: " . $_FILES["file"]["error"] . "<br />"; } else { echo "Upload: " . $_FILES["file"]["name"] . "<br />"; echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />"; if (file_exists("../uploaded/" . $_FILES["file"]["name"])) { echo $_FILES["file"]["name"] . " already exists. "; } else { $url = '../uploaded/'; move_uploaded_file($_FILES["file"]["tmp_name"], "$url/" . $_FILES["file"]["name"]); echo "Stored in: " . "../uploaded/" . $_FILES["file"]["name"]; } } ?> And I'm stuck from there.. I know how to get it to actually upload and stuff but I just can't find out how to put down it's url and name into mysql straight after uploading.. And also, I want to know how to make it so when they upload it, the server gives the files a unique, random name and saves it.. But then, how do I get it to be downloaded as the actual file name? /Confusing. Link to comment https://forums.phpfreaks.com/topic/106859-upload-file-then-put-its-name-and-url-in-mysql/ Share on other sites More sharing options...
Cory94bailly Posted May 23, 2008 Author Share Posted May 23, 2008 BUMP Link to comment https://forums.phpfreaks.com/topic/106859-upload-file-then-put-its-name-and-url-in-mysql/#findComment-548324 Share on other sites More sharing options...
Cory94bailly Posted May 23, 2008 Author Share Posted May 23, 2008 =/ Sorry but BUMP Link to comment https://forums.phpfreaks.com/topic/106859-upload-file-then-put-its-name-and-url-in-mysql/#findComment-548454 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.