簡體   English   中英

move_uploaded_file php函數不能正常工作

[英]move_uploaded_file php function is not working

我很清楚在這個網站上多次回答類似的問題。 我google和搜索很多論壇bt我無法解決問題。

move_uploaded_file函數不起作用,此函數由於適當的路徑無法上傳文件。

這是我的代碼

$targetPath = "/home/abc/public_html/uploads/";

        let my website is abc.com

        move_uploaded_file($_FILES['Filedata']['tmp_name'],$targetPath.$_FILES['Filedata']['name']);
  • 我必須在/public_html/uploads/downloads上傳文件
  • move_uploaded_file函數位於/public_html/assets/uploadify
  • 輸入表單位於/public_html/application/modules/downloads/views/admin位置

注意:此代碼在我的localhost中正常工作

任何人都可以建議路徑

Plz dnt標記為dublicate

假設您的上傳文件位於public_html目錄中,請將$ targetPath更改為/uploads/並進行更改

move_uploaded_file($_FILES['Filedata']['tmp_name'],"$targetPath".$_FILES['Filedata']['name']);

這對我有用。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM