file upload not working

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Nikola Skoric

    file upload not working

    Hello,

    I'm having trouble uploading files via post method. I'm using this code for the form:

    <form enctype="multip art/form-data" method="POST" action="run_dod aj_alb.php">
    <p>Naziv albuma:<br><inp ut type="text" name="naziv" size="35" value="<?php if (isset($row->naziv)) echo $row->naziv; ?>"></p>
    <p>Godina izdanja: <input type="text" name="godina" size="4" value="<?php if (isset($row->godina)) echo $row->godina; ?>"></p>
    <p>Slika:<br><i nput type="file" name="fajla"><b r>
    <?php if (isset($_POST['edit'])) { ?><input type="submit" name="Submit" value="Samo makni trenutacnu sliku"><?php } ?>
    <input type="hidden" name="MAX_FILE_ SIZE" value="500000"> </p>
    <?php
    if (isset($_POST['edit'])) { ?>
    <input type="hidden" name="edit" value="<?php echo $_POST['edit']; ?>">
    <p><input type="submit" value="Uredi album"></p>
    <?php } else { ?>
    <p><input type="submit" value="Dodaj album"></p>
    <?php }
    ?>
    </form>

    And this code for handling upload:
    if ($_FILES['fajla']['name']!="") {
    $slika="slike/" . $_FILES['fajla']['name'];
    echo $_FILES['fajla']['tmp_name'] . "<br>";
    move_uploaded_f ile($_FILES['fajla']['tmp_name'], "/home/users/n/nick/public_html/umzpa/rokeri/" . $slika);
    //print_r($_FILES );
    $slika="'" . $slika . "'";
    } else $slika="NULL";

    Now, the file doesn't get uploaded. Not to the $slika place, anyway. I searched
    for the $_FILES['fajla']['tmp_name'] file, but it doesn't seem to be there. Where
    do I start searching for the problem?

    --
    "Stara boljka se leci starim lekom...
    Dabome vinom, ta nebi valjda mlekom?"
  • Jeffrey Silverman

    #2
    Re: file upload not working

    On Mon, 21 Jun 2004 09:44:21 +0000, Nikola Skoric wrote:
    [color=blue]
    > Hello,
    >
    > I'm having trouble uploading files via post method. I'm using this code for the form:[/color]
    <snip!>[color=blue]
    > Now, the file doesn't get uploaded. Not to the $slika place, anyway. I searched
    > for the $_FILES['fajla']['tmp_name'] file, but it doesn't seem to be there. Where
    > do I start searching for the problem?[/color]



    --
    Jeffrey D. Silverman | jeffrey AT jhu DOT edu
    Website | http://www.wse.jhu.edu/newtnotes/

    Comment

    • Nikola Skoric

      #3
      Re: file upload not working

      Dana Mon, 21 Jun 2004 12:42:46 -0400,
      Jeffrey Silverman <jeffrey@jhu.ed u> kaze:[color=blue]
      > On Mon, 21 Jun 2004 09:44:21 +0000, Nikola Skoric wrote:
      >[color=green]
      >> Hello,
      >>
      >> I'm having trouble uploading files via post method. I'm using this code for the form:[/color]
      ><snip!>[color=green]
      >> Now, the file doesn't get uploaded. Not to the $slika place, anyway. I searched
      >> for the $_FILES['fajla']['tmp_name'] file, but it doesn't seem to be there. Where
      >> do I start searching for the problem?[/color]
      >
      > http://us4.php.net/features.file-upload[/color]

      Yes, yes, I copy/pasted the code from there and then edited it a little bit. But
      it doesn't work...

      --
      "Stara boljka se leci starim lekom...
      Dabome vinom, ta nebi valjda mlekom?"

      Comment

      Working...