0 Replies Latest reply on Apr 21, 2006 8:53 AM by frashjiveturkey

    uploading via php and getNetText or postNetText

    frashjiveturkey Level 1
      I'm trying to get a director file to upload to webspace by posting a form to a php script.
      Here's the php I'm using...

      <?php
      // Configuration
      $uploaddir = "uploads"; // Where you want the files to upload to - Important: Make sure this folders permissions is 0777!
      $max_size = "100000000"; // 50000 is the same as 50kb
      // Check File Size
      if($_FILES['file']['size'] > $max_size)
      {
      print "File size is too big!";
      exit;
      }
      // Upload Part
      if(is_uploaded_file($_FILES['file']['tmp_name']))
      {
      move_uploaded_file($_FILES['file']['tmp_name'],$uploaddir.'/'.$_FILES['file']['name']);
      }
      print "Your file has been uploaded.";
      ?>

      It works as planned when using an html form...

      <form action="ul.php" method="post" ENCTYPE="multipart/form-data">
      File: <input type="file" name="file" size="30"> <input type="submit" value="Upload!">
      </form>

      But I can't get postNetText or getNetText to work.
      neterror(mynetid) get's returned as ""
      and netdone sits at 0

      I've tried a few variations of lingo but nothing seems to work.

      postnettext(" http://mysite.com/dev/upload.php", [#file:the moviepath&"test_ul.txt"])

      postnettext(" http://mysite.com/dev/upload.php", [#file:"test_ul.txt"])

      getnetid = getnettext(" http://mysite.com/dev/upload.php?" & "file=test_ul.txt")

      Thanks in advance for any help!