开发者

How do I create a PHP page which can accept file uploads?

I want to upload a file to m开发者_如何学JAVAy server from some application. How can I code a PHP page to accept this file?


The application should just include the file in an HTTP POST request as would an HTML form with an input of type file. In the PHP code, the posted file contents would be available in the $_FILES array.

Lots more information here.

Keep in mind that the concept of a "file" doesn't mean the same thing over HTTP that it does on a local computer or on the target server. In HTTP, the "file" is just a stream of data wrapped in an HTTP request or response with a given content type and various other headers, no different from a web page or an image or any other request/response.


I would suggest reading the PHP manual chapter on handling file uploads

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜