# 大文件上传

php中目前的上传原理:上传的整个文件提交到服务器的临时目录,然后再把临时目录的文件移动要需要的保存的地方,php]默认执行的时间是30s,如果一个文件超大,很可能会发生超时.(并且通常post的最大文件M数都是有限制的),导致上传不成功

## **大文件上传的方法:**

* 客户端控件: 需要本地安装指定控件
* 采用swfUpload、uploaddify等Flash组件
* 用XMLHttpRequest实现文件上传和断点续传

## XMLHttpRequest 2.0 的新特性

* 可以上传文件
* 可以设置HTTP请求的时限
* 可以使用FormData对象管理表单数据
* 可以请求不同域名下的数据（跨域请求）
* 可以获取服务器端的二进制数据
* 可以获得数据传输的进度信息


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://phper.shujuwajue.com/phpwen-jian-bian-cheng/da-wen-jian-shang-chuan.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
