Trouble uploading image

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • laredotornado@zipmail.com

    Trouble uploading image

    Hi,

    I'm using PHP 4 and trying to upload an image. I think I'm using the
    right "enctype". Here is the form I submit

    <form name=addPhotoFo rm enctype="multip art/form-data" method=post
    action="add_pho to_response.php ">
    <table width="100%" cellpadding="0" cellspacing="0" border="0">
    <tr><td colspan="2" align="center" class="subHeade rClass">Add
    Photo</td></tr>
    <tr>
    <td align="right">T itle:&nbsp;</td>
    <td align="left"><i nput type="text" maxlength="255" name="TitleP"
    id="TitleP" value=""></td>
    </tr>
    <tr>
    <td align="right">P hoto:&nbsp;</td>
    <td align="left"><i nput type="file" name="PhotoImgP "
    id="PhotoImgP"> </td>
    </tr>
    <tr><td colspan="2" align="center"> <input type="submit"
    value="Submit"> </td></tr>
    </table>
    </form>

    But in my response page, I get these warnings when I try and check the
    value of $_FILES['PhotoImgP'] ...

    print "photo param: " . $_REQUEST['PhotoImgP'] . "file: " .
    $_FILES['PhotoImgP'] . " " . $_FILES['PhotoImgP']['tmp_name'];

    produces

    Notice: Undefined index: PhotoImgP in
    /usr/local/apache/htdocs/collegedropout/admin/photos/add_photo_respo nse.php
    on line 10

    Notice: Undefined index: PhotoImgP in
    /usr/local/apache/htdocs/collegedropout/admin/photos/add_photo_respo nse.php
    on line 10
    photo param: shirt.jpgfile: param name: PhotoImgP dest dir:
    /usr/local/apache/htdocs/collegedropout/images/photos src_file_path :


    Can someone help? Thanks, - Dave

  • Carl Vondrick

    #2
    Re: Trouble uploading image

    [color=blue]
    >
    > Can someone help? Thanks, - Dave
    >[/color]
    Is your server configured to accept file uploads?

    Read this: http://www.php.net/manual/en/features.file-upload.php

    --
    Carl Vondrick
    Professor of Computer Science at Columbia University, researching computer vision, machine learning, and AI applications.

    usenet [at] carlsoft [dot] net

    Comment

    • Raqueeb Hassan

      #3
      Re: Trouble uploading image

      > photo param: shirt.jpgfile: param name: PhotoImgP dest dir:[color=blue]
      > /usr/local/apache/htdocs/collegedropout/images/photos src_file_path :[/color]


      Just a query, where did you assign the upload directory and other
      variables?


      --
      Raqueeb Hassan
      Bangladesh

      Comment

      Working...