File Management Basics Part 2 PHP


Published on

Learn about the extended features of ProdigyView's file management. Includes mime types, extensions, directory, manipulation, etc.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

File Management Basics Part 2 PHP

  1. 1. File Management Part 2
  2. 2. OverviewObjectiveLearn about the other features of file management inProdigyViewRequirements Understanding of the DEFINES Basic knowledge of the file managerEstimated Time5 Minutes
  3. 3. Follow Along With Code Example 1. Download a copy of the example code at 2. Install the system in an environment you feel comfortable testing in. 3. Proceed to examples/util/FileManagement2.php
  4. 4. 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().
  5. 5. Mime Type ResultResults of getting the mime type of the file.
  6. 6. 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().
  7. 7. File Size Result
  8. 8. 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
  9. 9. File In DirectoryBelow is only an abbreviated list of all the files in adirectory.
  10. 10. 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
  11. 11. File in Directory Verbose An abbreviated verbose list of the files in the PV_CORE folder.File Location File Information
  12. 12. 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
  13. 13. 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
  14. 14. 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: