Using storage to upload and download files on SAE, saestorage_PHP tutorial

WBOY
Release: 2016-07-13 09:49:32
Original
1130 people have browsed it

Use storage to upload and download files on SAE, saestorage

<?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'] );  //上传
?>
Copy after login
<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>
Copy after login

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1019336.htmlTechArticleUse storage to upload and download files on SAE, saestorage ?phpif ($_FILES["file"]["error" ] 0) { echo "Error: " . $_FILES["file"]["error"] . "br /"; }else { echo "Upload: " . $_FILES["f...
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template