PHP File upload and overwrite file with same name

后端 未结 4 1698
天涯浪人
天涯浪人 2020-12-14 22:23

I am making an application that allows users to upload a file in a directory via PHP.

I am having problems because it dose not allow me to overwrite files with the s

4条回答
  •  借酒劲吻你
    2020-12-14 22:53

    if (file_exists("documenti/$fileName"))
     { 
     unlink("documenti/$fileName");
    
     echo "Last Uploaded File has been removed from uploads folder
    back to uploadform agian and upload your file
    ";// now your file which uploaded before was deleted from uploads folder you can open it and check if it removed or not , so no you should go back to uploadform again and import your file which will uploaded correctly echo "


    Back to upform
    "; }

提交回复
热议问题