SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Hybrid View

  1. #1
    SitePoint Zealot
    Join Date
    May 2001
    Posts
    141
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    What is wrong with this code??

    Hi all,

    Just wondering if anyone can tell me what is wrong with the following code, if anything. I can enter details into the database just fine using my PHP script, but when it comes to file uploading I get an error. Thanks for any help! See my post below if you want to see more of the code, and my post below that if you want to see the full code (although it has been modified as suggested in some of the replies).
    Cheers,

    -XGuy.

    PHP Code:
      if (copy($userfile,"../documents/articles/$userfile_name"))
                     echo(
    "<B> File successfully uploaded</B>"); 

  2. #2
    code addict Abstraction's Avatar
    Join Date
    Apr 2001
    Location
    Des Moines, IA
    Posts
    346
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Just a guess...

    but it may be a permissions problem.

  3. #3
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah, it would pretty much have to be. That code looks just fine to me. I see nothing wrong...though I have been wrong in the past.

  4. #4
    SitePoint Addict
    Join Date
    Apr 2001
    Location
    None
    Posts
    254
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  5. #5
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can use relative paths here, I am 99% sure its a permissions problem or a wrong path problem.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  6. #6
    SitePoint Enthusiast vsantola's Avatar
    Join Date
    Jan 2001
    Location
    Portugal
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    just chmod your articles path to 775 and your problem should disapear
    try this:

    chmod 775 ../documents/articles/


    cheers!
    Valter Santos

    rooco is my creature (a mix of a bear with a kanguroo)... he is trained in perl, PHP and is getting a java certification right now

  7. #7
    SitePoint Zealot
    Join Date
    May 2001
    Posts
    141
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thanks!!

    Thanks everyone!! It was a server permissions error...didn't think there was anything wrong with my script, but figured I would run it by you instead. Thanks very much, and I am sure I will have more questions soon!

    Cheers,

    -XGuy.


Bookmarks

Posting Permissions

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