Sunday, 15 July 2012

file - How to make a php script that reads filenames and details from any directory and stores it on database? -


I have given too many video files in my server folder, so it is impossible to add them all, I have a php script which Read the content of a folder and populate your database table with details such as file name, size, path etc. Apart from this, I need to use that data to display the users' list of videos so that everything is correct. Please tell me how?

I suggest you use an iterator from an SPL (stand-up PPP library) for an OOP approach You must use the DirectoryRecursiveIterator for recursive iterations

  $ directoryIterator = new recurring directoryir ("/ path /"); $ RecursiveIterator = New recurring iterator iterator ($ directorytitler); Forex Currency ($ recurring Eater $ filename => $ fileInfo) {$ filesize = $ fileInfo-> GetSize (); $ Path = $ fileInfo-> GetPath (); // insertDataIntoMysql ($ filename, $ filesize, $ filepath); }  

No comments:

Post a Comment