Home > Article > Backend Development > PHP implements the method of using storage to upload and download files on SAE, _PHP tutorial
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:
<?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'] ); //上传 ?> <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.