English 中文(简体)
PHP文档上有哪些辅助档案类型?
原标题:What are the supported file types in a PHP file upload?

What are the supported file types in php file upload?

   Choose a file to upload: <input name="uploadedfile" type="file" />
   <br />
      Username:<input type="text" name="username">
   <br />
      Password:<input type="text" name="password">
   <br />
      FaxNumber:<input type="text" name="faxnumber">

   <input type="submit" value="Upload File" />

问题回答

购买力平价并不限制类似的情况。 档案永远只是数据。 PHP向您提供,当数据“被贴出”(或上载)到服务器时。 它确实只是说,“这一数据是上载的,这里是通往临时档案的道路”。 只要你的服务器能够处理整个档案的接收,所有材料都可以接受。 您是否希望限制能够上载的种类,完全由您负责。

There is no limit client side, all files/types are supported. PHP, also, has no built in limits and supports all files. If you want to limit what can be uploaded in php it looks something like the following snippet, Which limits the file to a gif image:

if ($_FILES["file"]["type"] == "image/gif"){
    //do stuff here
}
else{
    //the file was wrong type handle error here
}

You can find a list of MIME types, "image/gif" in the above code, at:
http://en.wikipedia.org/wiki/Internet_media_type#List_of_common_media_types

Maybe you need this : http://en.wikipedia.org/wiki/Internet_media_type

档案类型不因缺省而受到限制,除非你具体规定限制。

有效载荷档案类型:

$_FILES[ yourFileName ][ type ]
by default: nearly anything you want (pdf,txt,exe,jpg) etc.

Its your job to filter out anything you do wish to use. you can filter against anything inside $_FILES array(type,size) etc

PHP will support all file types for file upload, But you have to validate for some file extensions which can hack your site and also you have to consider file size to avoid long running script.

PHP没有上载。 有效载荷由http://europa-eu-un.org提供,由您的网络服务(Apache、IIS等)处理。

不管怎样,如果你想要节省上载的档案,那么所有档案类型都应进行罚款。 如果你想把上载的档案作为投入处理,那么事情就会更加美发。





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签