Home  >  Article  >  Backend Development  >  PHP implements the method of using storage to upload and download files on SAE, _PHP tutorial

PHP implements the method of using storage to upload and download files on SAE, _PHP tutorial

WBOY
WBOYOriginal
2016-07-13 09:48:201073browse

PHP implements the method of using storage to upload and download files on SAE.

The example in this article describes the method of PHP using storage to upload and download files on SAE. Share it with everyone for your reference. The details are as follows:

<&#63;php
if ($_FILES["file"]["error"] > 0)
{
 echo "Error: " . $_FILES["file"]["error"] . "<br />";
}
else
{
 echo "Upload: " . $_FILES["file"]["name"] . "<br />";
 echo "Type: " . $_FILES["file"]["type"] . "<br />";
 echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
 echo "Stored in: " . $_FILES["file"]["tmp_name"];
}
$s =new SaeStorage();
$i='PDF/'.$_FILES['file']['name']; //文件名
$domain='store'; //storage名
$s->upload( $domain , $i ,$_FILES['file']['tmp_name'] ); //上传
&#63;>
<html>
<body>
<form action="test3.php" method="post"
enctype="multipart/form-data">
<label for="file">Filename:</label>
<input type="file" name="file" id="file" />
<br />
<input type="submit" name="submit" value="Submit" />
</form>
</body>
</html>

I hope this article will be helpful to everyone’s PHP programming design.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1024130.htmlTechArticlephp implements the method of using storage to upload and download files on SAE. This article describes the example of using php to implement using storage to upload on SAE. How to download files. Share it with everyone for your reference. Specifically...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn