Results 1 to 6 of 6

Thread: File Upload

Threaded View

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787

    File Upload

    Ok i'm missing somthing here, i've done file uplaod a million times but i cant get this one working.....

    my upload script is below.

    PHP Code:
    <?php
    $uploaddir 
    "http://lindowltc.org.uk/news/"

    if(
    is_uploaded_file($_FILES['file']['tmp_name']))
    {
    move_uploaded_file($_FILES['file']['tmp_name'],$uploaddir.'/'.$_FILES['file']['name']);
    }

    $path "http://'site'.org.uk/news/" $_FILES['file']['name'];
    $msg "Image Uploaded";

    $host="localhost";
    $user="a";
    $password="b";
    $database="c";

    $connection mysql_connect($host,$user,$password);
    $db mysql_select_db($database,$connection);

    $query =("REPLACE INTO tblNews(id,news) VALUES (1,'$path')");

    header('Location: http://'site'/Admin/news/upload.php?path='.$path."&msg=".$msg);
    ?>
    I'm trying to store the path the file is uploaded to (So and replace the existing path in the DB)

    PHP Code:
    <form enctype="multipart/form-data" action="doUpload.php" method="post">
    <
    input type="hidden" name="MAX_FILE_SIZE" value="500000">
    <
    strong>Upload An Image</strong> -<input type="file" name="file" size="60">
    <
    input type="submit" name="upload" value ="Upload News">
    </
    form
    That the actual upload form,

    Am i missing somthing simple here?

    the errors are,

    Warning: move_uploaded_file(http://path/news//50.jpg[/url]): failed to open stream: HTTP wrapper does not support writeable connections. in /home/lindowltcuk/public_html/Admin/letter/doUpload.php on line 6

    Warning: move_uploaded_file(): Unable to move '/tmp/phpnRLz5L' to 'http://path/news//50.jpg' in /home/path/public_html/Admin/letter/doUpload.php on line 6
    http://path/news/50.jpg
    Warning: Cannot modify header information - headers already sent by (output started at /home/path/public_html/Admin/letter/doUpload.php:6) in /home/path/public_html/Admin/letter/doUpload.php on line 23
    Last edited by Pino; May 14th, 2005 at 09:50 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width