Results 1 to 2 of 2

Thread: File upload problem using apache

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2004
    Posts
    1

    File upload problem using apache

    Hi!
    Im running apache on windows XP proffessional and i wanted to make a simple file upload script to my computer. The problem is that when i upload from my computer to my computer the file gets uploaded but when somebody else tries to upload it remotely, nothing happens - no error messages - it just wont upload. Is there a problem with my apache configuring skills or something else. The file to be uploaded is JPEG so different formats shouldnt be the case. I have added the code below:

    PHP Code:
    <?php 
        
    if(($_FILES['file']['type']=='image/jpeg')&&($_FILES['file']['size']<1000000)){ 
            
    $pic='/web/Pic/Pictures/'.$_POST['name'].'.jpeg'
            
    move_uploaded_file($_FILES['file']['tmp_name'], $pic); 
        } 
    ?> 

    <form action='upload.php' method='POST' ENCTYPE='multipart/form-data'> 
        <input type='file' name='file' size='5'><br /> 
        <input type='text' name='name' /> 
        <input type='submit' name='submit' value='LISA PILT' /> 
    </form>
    Thanks in advance.

  2. #2
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    because it is not a POST name

    $pic='/web/Pic/Pictures/'.$_POST['name'].'.jpeg';


    should be

    $pic='/web/Pic/Pictures/'.$_FILES['file']['name'];

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