This example describes how PHP obtains file types and file information. Share to everyone for your reference. The implementation methods are as follows:
What is the MIME type, which is the type of file that sets an extension to open with an application, and when the
; getTypeList ();
}
/**
* Process the file type ing table *
*
* @ Param string $ filename File type
* @ Return string file type. the returned value is other.
*/
Private function _ getFileType ($ filename)
{
$ Filetype = "other ";
If (! File_exists ($ filename) throw new Exception ("no found file! ");
$
; getTypeList ();}/*** Process the file type ing table *** @ Param string $ filename File type* @ Return string file type. the returned value is other.*/Private function _ getFileType ($ filename){$ Filetype = "other ";If (! File_exists ($ filename) throw new Exception ("no found file! ");$
In our own applications, custom types of files are often used to store data related to the application, such as the. osf file, which is the application's project file. If the file type is not registered with the Windows registry, then. The icon for the OSF file will be the d
PHP methods for obtaining file types and file information,
The examples in this article describe how PHP obtains file types and file information. Share to everyone for your reference. The implementation method is as follows:
";//
=NewFileInputStream (FilePath); byte[] B =New byte[20]; Is.read (b,0, b.length); Value=bytestohexstring (b); } Catch(Exception e) {}finally { if(NULL!=is ) { Try{is.close (); } Catch(IOException e) {}}} returnvalue; } /*** Convert a byte array of the file that will read the header information to a string type representing * *@paramsrc * A byte array of files to read the header information of the
ISS download different suffix name file will be limited, the Internet to find some information, are very old, their own re-organized under.After the configuration is complete, all files in the access site will be forced to download, prompting the download window, including all the files such as Asp,php,txt.The solution is mainly implemented by modifying MIME information, MIME reference manual: Http://www.w3school.com.cn/media/media_mimeref.asp1. Click
the header file of a program; header filesShare: structured, independent dataDoc, manLocal: The installation location of the commonly used third-party programs now;BinSbinLibLib64etcShare/var:variable Data Files Variable directoryCache: Application Caches dataLIB: Status information data for an applicationLocal: Dedicated to storing variable data for applications under/usr/local;Lock: Lock fileLOG: Journal fileOPT: Dedicated to/optSpool: The data poo
Description of the File command used to identify the File type in Linux-general Linux technology-Linux technology and application information. The following is a detailed description. We know that the Linux File System is one of the basic functions supported by the Linux kernel, and the hierarchical structure of the inverted tree is formed from the root/start.
permissions for groups and others in xxx.xxxwhichU on behalf of owner (user)G represents the group where the owner residesO stands for others, but not u and g (other).A represents all people, including U,g and O.R indicates that a file can be read (read)W indicates that the file can be written (write)x indicates that the file can be executed (if it is a program)
1. Upload the selected file to the target location:"White-space:pre"> //get the file name of the uploaded file stringName =Fileupload1.filename; //stitching the file name into the desired relative path stringPath ="images/"+ DateTime.Now.ToString ("YYYYMMDDHHMMSS") +name; //perform the Save As met
devices on the current system/selinux:security Enhanced Linux:selinux The storage location of information such as the relevant security policyComponents of an application on Linux:Binary program:/bin,/sbin,/usr/bin,/usr/sbin,/usr/local/bin,/usr/local/sbinLibrary files:/lib,lib64,/usr/lib,/usr/lib64,/usr/local/lib,/usr/local/lib64Configuration file:/etc,/etc/directory,/usr/local/etcHelp file:/usr/share/man,
The example in this article describes how Java in Android obtains file types based on file headers. Share to everyone for your reference, specific as follows:
We've talked about the MediaFile class inside the Android system to get the file type, which is largely based on the file
/sys/kernel/debug type Debugfs (rw)
None on/sys/kernel/security type SECURITYFS (rw)
Udev On/dev type DEVTMPFS (rw,mode=0755)
Devpts on/dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
Tmpfs on/run type TMPFS (rw,noexec,nosuid,size=10%,mode=0755)
None On/run/lock type TMPFS (rw,noexec,nosuid,nodev,size=5242880)
None On/run/shm type TMPFS (Rw,nosuid,nodev)
None On/run/user type TMPFS (rw,noexec,nosuid,nodev,size=104857600,mode=0755)
None On/sys/fs/pstore type Pstore (rw)
/dev/sda8
Tags: special binary data format problem file type wrong development strong name file types and extensions for LinuxI. Types of documents:1. Ordinary files (regular file) the first character is [-]Including:① Plain text file (ASCI
effect;5) Delete Files hard link file, the source files and soft link files have no effect;6) Delete the original file of the linked file, no impact on the hard-link file, will cause its soft link failure (red on white blinking);7) Delete the original file and its hard link
Determine the true type of the file, not by extension: Related:ASP. Three ways to determine the type of upload fileOriginal link: http://www.cnblogs.com/babycool/p/3531696.htmlC # determines file types based on file stream
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.