OverviewObjectiveLearn about the other features of file management inProdigyViewRequirements Understanding of the DEFINES Basic knowledge of the file managerEstimated Time5 Minutes
Follow Along With Code Example 1. Download a copy of the example code at www.prodigyview.com/source. 2. Install the system in an environment you feel comfortable testing in. 3. Proceed to examples/util/FileManagement2.php
File Mime TypeThere will be various times, and most likely during fileuploads, that a file’s mime type will be checked. That canbe accomplished with the method getFileMimeType().
Mime Type ResultResults of getting the mime type of the file.
File Size - PerlTo get the size of a file, we could simply use php’s filesize()function. Or we could use the outside language of perl to getthe file size for us. If you are on Windows, you can utilize amethod called getFileSize_NTFS().
Files in DirectoryQuite possibly the coolest function in the FileManager isgetFilesInDirectory() function. It will return all files andfolders in a directory. Retrieve all files in the location of PV_CORE define
File In DirectoryBelow is only an abbreviated list of all the files in adirectory.
Files In Directory VerboseAn option to retrieve a detailed list of the files in adirectory is the verbose option. It will return informationsuch as mime type, extension and other usefulinformation. Set verbose to true
File in Directory Verbose An abbreviated verbose list of the files in the PV_CORE folder.File Location File Information
Last File In DirectoryIf you ever have had the need and the frustration offinding the latest file in a directory, be frustrated no more.The ability to do this is a simple line of code. Get the newest file in the define of PV_CORE
Challenge!This is an optional challenge to help you betterunderstand file management in ProdigyView.1. Pick a directory you want to retrieve all the files and folders in.2. Read that directory in verbose mode into PVFileManager::getFilesInDirectory().3. If the file is a directory, make a link that opens the directory. If the file is a file, read the contents of the file in with PVFileManager::readFile().4. Get the newest file that has been added
API ReferenceFor a better understanding of file management inProdigyView, visit the api by clicking on the link below.PVFileManager More TutorialsFor more tutorials, please visit:http://www.prodigyview.com/tutorials www.prodigyview.com