本文实例讲述了PHP实现SAE上使用storage上传与下载文件的方法。分享给大家供大家参考。具体如下:
PHP;">
0)
{
echo "Error: " . $_FILES["file"]["error"] . "
"; } else { echo "Upload: " . $_FILES["file"]["name"] . "
"; echo "Type: " . $_FILES["file"]["type"] . "
"; echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb
"; 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'] ); //上传 ?>
"; } else { echo "Upload: " . $_FILES["file"]["name"] . "
"; echo "Type: " . $_FILES["file"]["type"] . "
"; echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb
"; 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'] ); //上传 ?>
希望本文所述对大家的PHP程序设计有所帮助。