2014年4月11日 星期五

php 上傳檔案的相關資訊

上传档案的网页
enctype="multipart/form-data"
 action="__URL__" method="POST">
   
   
   
    Send this file: userfile" type="file" />
   
p.s. 重點
* form要加上 enctype="multipart/form-data"才能上傳檔案
* 上傳檔案的input type要設為file

接收参数阵列
档案名称
$_FILES['userfile']['name']
档案格式(image/jpeg)
$_FILES['userfile']['type']

档案大小
$_FILES['userfile']['size']

档案暂存的位置(伺服器上暂存的位置,必须要移动到正确的位置)
$_FILES['userfile']['tmp_name'] 

错误讯息
$_FILES['userfile']['error']
P.s. $_FILE['xxxxx']裡頭的xxxxx取決於你form裡頭選擇檔案input的"name"

沒有留言:

Windows Server因為Windows update後,導致自動重啟或是自動重新開機

從 Windows Server 2016 開始,微軟確實改變了更新機制,使其行為更接近消費端的 Windows 10,這在伺服器管理上引發了不少討論。 以下為您確認微軟在 Windows Server 2016 上的具體行為: 1. 預設行為:自動下載與安裝 在 Windows...