Get File Size and File Type In PHP
With this PHP script you can find size and type (extension) of required file.
Posted in: File, File Manipulation, Info, Tricks
Post's RSS » RSS 2.0
Post's Comments RSS » RSS 2.0
Respond: Post A Comment
![]() |
With this PHP script you can find size and type (extension) of required file.
I have other solutions to find file path at server or file name using PHP. The thing is, some php scripts might not work with some versions of PHP or in some situations. So more methods you learn for each task with PHP, the better. Here goes more solutions; Enjoy!
In this example I used CurrentpageURL.php page and tested it via wamp server at local host.
File append means to add on to the existing data, then you need to open the file in append mode.
When you view the contents of a directory you can see all the files that exist in that directory because the operating system or application that you are using displays a list of filenames. You can think of these filenames as links that join the files to the directory you are currently viewing. If you unlink a file, you are effectively causing the system to forget about it or delete it! Before you can delete (unlink) a file, you must first be sure that it is not open in your program. Use the fclose function to close down an open file.
We have to use the function fopen to open the file for reading. Here’s the code to read-open the file.