Recently upgraded the php of my server and facing file uploading issue

Posted on 2012-08-30
Last Modified: 2012-08-30
Dear All
recently i upgraded to my php 5.2.17 in 5.4.6 and my php stop working

and give me this error
Warning: move_uploaded_file(./Desktop.ini): failed to open stream: Permission denied in /home/****/****.php on line 11

line 11 is here

if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {

help me to solve this issue
Question by:udayrathor
    LVL 36

    Accepted Solution

    It is a permission problem for the folder path. Check the folder permission.
    LVL 13

    Expert Comment

    That code worked on 5.2.17  or you just wrote that and its not working?
    My best guess is to first try to debug it by echoing the $_FILES['uploadedfile']['tmp_name'] , the  $target_path and finally you can try moving something to another location. It seems as logudotcom mentioned , a permission problem.
    please feedback your findings.
    LVL 13

    Expert Comment

    also , you can use this example ("borrowed" from

    if (is_uploaded_file($_FILES['userfile']['tmp_name'])) {
       echo "File ". $_FILES['userfile']['name'] ." uploaded successfully.\n";
       echo "Displaying contents\n";
    } else {
       echo "Possible file upload attack: ";
       echo "filename '". $_FILES['userfile']['tmp_name'] . "'.";

    on this you first check if its uploaded and then try to move it.

    Author Closing Comment

    perfect solution
    LVL 36

    Expert Comment

    by:Loganathan Natarajan
    Thanks for your points & comment. Glad to help

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System ( introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
    This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
    Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now