PHP Error - Uploading a file

后端 未结 8 1593
春和景丽
春和景丽 2020-12-16 13:36

I\'m trying to write some PHP to upload a file to a folder on my webserver. Here\'s what I have:



        
相关标签:
8条回答
  • 2020-12-16 14:12

    OMG

    move_uploaded_file($_FILES['file']['tmp_name'], './' . $_FILES['file']['name']);
    

    Don't do that. $_FILES['file']['name'] could be ../../../../boot.ini or any number of bad things. You should never trust this name. You should rename the file something else and associate the original name with your random name. At a minimum use basename($_FILES['file']['name']).

    0 讨论(0)
  • As it's Windows, there is no real 777. If you're using chmod, check the Windows-related comments.

    Check that the IIS Account can access (read, write, modify) these two folders:

    E:\inetpub\vhosts\mywebsite.com\httpdocs\dump\
    C:\WINDOWS\Temp\
    
    0 讨论(0)
提交回复
热议问题