0

Hey guys I noticed when I switched my provider to a dedicated server (Winhost to MediaTemple) that my file uploading system no longer works because it can't read the file sent in for some reason. So I put aside a tester to figure out why and I used:

<form method="post" action="./readtest.php">
        <div>
            <span>Enter Name of First Name Column: </span><input name="firstname" class="Rfirstname-input" type="text" />
        </div>
        <div>
            <span>Enter .csv File: </span><input type="file" name="csvfile" value="" />
        </div>
        <div>
        <input type="submit" class="Rsubmit" value="Submit"/>
        </form>

than:

<?php
echo $_POST['firstname'];
var_dump($_FILES['csvfile']);
?>

Now the firstname post will print out but the dumping of the files is null (I upload .csv files). Now the weird part, when I change the $_FILES to $_POST - it actually prints out the name of the file, so it is actually going in yet not reading it? I tried for other files to.....I don't know if it is something in my .ini file for php or what but I could use the help!

David Biga

4

2 回答 2

2

Take a look at this answer:What does enctype='multipart/form-data' mean?

You are missing the enctype on your <form>

于 2013-03-30T22:41:03.417 回答
1

Add enctype="multipart/form-data" to your <form>.

于 2013-03-30T22:41:03.160 回答