php uploader not work in localhost

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • perhapscwk
    New Member
    • Sep 2007
    • 123

    php uploader not work in localhost

    I download several .php file(uploader, etc) from internet and it works in ftp.

    however, it not work in "local host". WHy? is it because of the folder
    permission?i using apache...anythi ng need to set there?

    how to set?

    thanks.
  • bnashenas1984
    Contributor
    • Sep 2007
    • 257

    #2
    It might be because of permissions on the folder youre trying to upload your files in.

    I can help you fix this problem with Windows XP. But if you have any other OS then check CHMOD command on www.php.net

    Here is what you have to do to fix the permissions on your folders (Windows XP).
    1- Open My Computer
    2- Go to Tools --> Folder options
    3- Go to the View tab and find this option on the list : Use simple file sharing (recommended)
    4- Uncheck the box and click OK
    5- Now go to the folder which needs to be changed for permissions
    6- Right click on the folder and go to properties.
    7- Go to the Security tab .. in the top list , choose the username you are using to log in to your windows and then change permissions for the specified user in the bottom list

    If you allow this user to read and write to this folder then your php uploader should work fine

    Good luck

    Comment

    • Atli
      Recognized Expert Expert
      • Nov 2006
      • 5062

      #3
      Originally posted by perhapscwk
      however, it not work in "local host". WHy?[...]
      How is it not working?
      Are you getting any error messages?

      There could be a lot of reasons why your server isn't doing what you want it to be doing. If you want us to be able to help, we need to know what it is you are trying to do and how it is not working.

      We need details, or we are forced to guess, and we don't like guessing :)

      Comment

      • perhapscwk
        New Member
        • Sep 2007
        • 123

        #4
        no error message.

        for premission things, i tried already for still not working.

        that php uploader..i tried in ftp and it works..

        thinking i may need some extension .dll for php or change some setting for apache....any suggestion?

        thanks.

        Comment

        • Atli
          Recognized Expert Expert
          • Nov 2006
          • 5062

          #5
          Have you tried turning on the debug messages?

          You still haven't given us enough info on the problem.
          What is this supposed to be doing and how is it failing to do so?
          We need details!

          Showing us the code that isn't working would also be a big help.

          Comment

          • perhapscwk
            New Member
            • Sep 2007
            • 123

            #6
            there are 2 files,....the upload.php..whi ch we can upload pictures, and all the uploader.php will return a $uploaded_files which will output in upload.php, so
            after pic upload...the page will add the filename to the bottom of the page.

            Please see below for some code in upload.php

            Code:
            <?
            	include("uploader.php"); 
            ?>
            
            ...upload pic form here......
            
            
            <? 
            	
            if($uploaded_files == "") echo "	
            <tr>
            <td colspan=\"2\" style=\"background: #fff; color: #000; text-align: center\"><br /><strong>There are no uploaded files.
            </strong><br /><br /></td>
            </tr>
            "; else echo $uploaded_files; ?>
            </table>
            Above page works if it is run on website, however, not work in localhost(Apach e
            + php5)....don;t know why...but in local host.....on upload.php...it always show
            below the end of the page. but in website....it only show There are no uploaded files if no file is save in folder "files"...

            below 2 sentence show if run display upload.php on localhost
            There are no uploaded files.

            "; else echo $uploaded_files ; ?>

            Comment

            • perhapscwk
              New Member
              • Sep 2007
              • 123

              #7
              anyone can help?


              thanks/

              Comment

              • bnashenas1984
                Contributor
                • Sep 2007
                • 257

                #8
                It might be because of (upload_max_fil esize) in your PHP.INI

                Try to upload files smaller than 1MB and see if it works

                Comment

                • perhapscwk
                  New Member
                  • Sep 2007
                  • 123

                  #9
                  not work as well........... .

                  Comment

                  • bnashenas1984
                    Contributor
                    • Sep 2007
                    • 257

                    #10
                    As Atli said before there could be alot of reasons why your code is not working.
                    I could come up with some reasons

                    1- Permissions on the specified folder
                    2- Having upload size limit in your PHP.INI
                    3- Using direct variables to uploaded file without $_files[] in a server with register_global s off

                    I'm sure there are more reasons I don't think of.

                    So, I think posting the actual code here might help. Show us your code to see what's wrong

                    Comment

                    Working...