Michael
Michael

Reputation: 169

File will not upload, PHP

I've written PHP scripts to upload files in the past, but for some reason this one isn't working…

The HTML looks like:

<form action="scripts/submit.php" method="push" enctype="multipart/form-data" name="submitGraphics" id="submitGraphics">
      <p>
        <label for="filefield"><strong class="red">*</strong> File:</label>
        <input name="filefield" type="file" id="filefield" tabindex="30" />
      </p>
</form>

The script looks like:

<?php

    $fileName = $_FILES["filefield"]["name"];
    $fileTmpLoc = $_FILES["filefield"]["tmp_name"];
    $fileErrorMsg = $_FILES["filefield"]["error"];

    echo "$fileName";
    echo "$fileTmpLoc";
    echo "$fileErrorMsg";
    print_r($_FILES);
?>

There is normally more afterwards, but I am now just testing to make sure the file is uploading (since it has not been working). All I get from this is nothing for the first three echo statements, and then a line saying Array().

I have modified the php.ini file in the nesesarry spots:

file_uploads upload_max_filesize max_execution_time post_max_size

Upvotes: 0

Views: 80

Answers (1)

John Kurlak
John Kurlak

Reputation: 6680

Change method="push" to method="post"

Upvotes: 1

Related Questions