Guest Posted November 2, 2009 Share Posted November 2, 2009 Hi there, I was wondering if there was a good way to upload files (like images, videos or sounds) somewhere in my website and store the location of the files into a database. I was starting to work on the "images" part of this and was about to store the files into my database but then I thought that might be a good idea because of the number of images and size it would be in the end. Anyone came up with the same issue? Link to comment https://forums.phpfreaks.com/topic/179961-upload-files-and-store-location-in-database/ Share on other sites More sharing options...
Garethp Posted November 2, 2009 Share Posted November 2, 2009 It's simple, take the basename and insert that into a table under the column name. Then use mysql_insert_id to get the ID of that file, and move_uploaded_file($_FILE['File'], "images/" . mysql_insert_id() . basename($_FILE['File'])); Link to comment https://forums.phpfreaks.com/topic/179961-upload-files-and-store-location-in-database/#findComment-949359 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.