upload problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tasneemm
    New Member
    • Mar 2007
    • 3

    upload problem

    good morning

    I thinks this code must upload a file , but I don't know why it didn't ..

    move_uploaded_f ile ($_FILES['new_logo']['temp_name'],"/uploads/logos/{$_FILES['new_logo']['name']}")
    .... any ideas ??


    thanks alot
  • xerc
    New Member
    • Mar 2007
    • 14

    #2
    I think we'd need to see more of the code to know for sure, but I suspect your problems are because:

    1) You do not have the proper root/working directory set. If you borrowed this script from somewhere else and/or put it on a different machine, then you will most likely have to check your upload and other paths are set correctly in the PHP.ini file.

    2) Ensure that the directories you are working with have proper write permissions. This is done differently depending upon Windows vs. Linux, but the idea is the same, you need write permission in a directory to move files.

    3) I'd have to test myself, but if the uploaded file's handle is still open (the one in the temp directory) then maybe you can't move it until the handle is closed from the previous 'write' process. This is really just a wild, wild guess. No basis to it, but worth checking after you've confirmed the above.

    Comment

    • Motoma
      Recognized Expert Specialist
      • Jan 2007
      • 3236

      #3
      Originally posted by tasneemm
      good morning

      I thinks this code must upload a file , but I don't know why it didn't ..

      move_uploaded_f ile ($_FILES['new_logo']['temp_name'],"/uploads/logos/{$_FILES['new_logo']['name']}")
      .... any ideas ??


      thanks alot
      Do you get any errors or warnings in your error log?

      Comment

      Working...