Undefined variable file and Permission denied

Discussion in 'PHP' started by <?erick?>, Jun 24, 2008.

  1. #1
    Notice: Undefined variable: file in C:\website\requestor.php on line 180

    Warning: move_uploaded_file(import): failed to open stream: Permission denied in C:\website\uhd_4_edit\requestor.php on line 180

    Warning: move_uploaded_file(): Unable to move 'C:\WINDOWS\TEMP\php12.tmp' to 'import' in C:\website\requestor.php on line 180

    how to solve this problem
     
    <?erick?>, Jun 24, 2008 IP
  2. bokiatenxi

    bokiatenxi Peon

    Messages:
    27
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Can you post the whole code or part of it? especially the line 180 the warnings are talking about...
     
    bokiatenxi, Jun 24, 2008 IP
  3. Demonic

    Demonic Active Member

    Messages:
    821
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    85
    #3
    Make sure the folder you are trying to upload to is chmodded to 0777. Posting the script also might help as he said above.
     
    Demonic, Jun 25, 2008 IP
  4. EricBruggema

    EricBruggema Well-Known Member

    Messages:
    1,740
    Likes Received:
    28
    Best Answers:
    13
    Trophy Points:
    175
    #4
    Indeed, post a piece of code so we can check it out.

    I think your $file is empty, maby used an script for php older then 4 wich allowed $file to have the same content as $_FILES..
     
    EricBruggema, Jun 25, 2008 IP
  5. <?erick?>

    <?erick?> Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    i think my problem is folder permission so how to conf. chmod 777. thanks
     
    <?erick?>, Jun 26, 2008 IP
  6. bokiatenxi

    bokiatenxi Peon

    Messages:
    27
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    you can change it using your ftp client..

    or if you want to do it programmatically, use the chmod() function of php...
     
    bokiatenxi, Jun 26, 2008 IP
  7. <?erick?>

    <?erick?> Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I tiered to configure using ws_ftp always cannot connect.note im only using localhost the client and server is only one machine am just practicing how to upload. And idea??
     
    <?erick?>, Jun 27, 2008 IP
  8. EricBruggema

    EricBruggema Well-Known Member

    Messages:
    1,740
    Likes Received:
    28
    Best Answers:
    13
    Trophy Points:
    175
    #8
    Yes as given above, you need to change the rights of your files and or directories you need to write in... that's all..
     
    EricBruggema, Jun 27, 2008 IP
  9. <?erick?>

    <?erick?> Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    hello i already set 777 permission but may new error is Notice: Undefined variable: file in my file directory how to solve this problem i ecounter this problem during moving file from temp folder to my create directory. tnx
     
    <?erick?>, Jun 29, 2008 IP