TeddyKrulewich Posted August 22, 2006 Share Posted August 22, 2006 I am learning php, and i know flash, javascript,html,C++, SOME python. Anyway, I was following the tutoirals on this site and I got to teh upload file tutoiral. When I uploaded the php files and tested them, it seems to work fine but I used fireftp to look at my site and i dont see any files. Link to comment Share on other sites More sharing options...
justsomeguy Posted August 22, 2006 Share Posted August 22, 2006 Check this reference:http://www.php.net/manual/en/features.file-upload.phpThere are a lot of code samples in the user notes on the page as well. Link to comment Share on other sites More sharing options...
TeddyKrulewich Posted August 22, 2006 Author Share Posted August 22, 2006 just to let you know. The php file is www.teddykrulewich.com/Untitled-1.phpEDIT:It still doesnt work. Itried the code from that web site(which is a little different) and it says:Possible file upload attack!Here is some more debugging info:Array( [userfile] => Array ( [name] => mozilla.gif [type] => image/gif [tmp_name] => /tmp/phpAvS9fr [error] => 0 => 12859 )) Link to comment Share on other sites More sharing options...
justsomeguy Posted August 22, 2006 Share Posted August 22, 2006 Then the call to move_uploaded_file is failing. From experience, most of the problems with move_uploaded_file are due to permissions. Print out the path you are trying to move the file to, make sure it exists and is a valid path, and make sure you have write permission on the directory.The file did upload successfully, because the error code in the file array is 0. It is most likely a permission issue.The other issue may be that the file does not exist, but you can use is_uploaded_file to check for that beforehand and make sure that it exists before you try to move it. In fact, you should use is_uploaded_file to make sure someone is not trying to hack the server by giving a system file name as the uploaded file.http://www.php.net/manual/en/function.is-uploaded-file.php Link to comment Share on other sites More sharing options...
TeddyKrulewich Posted August 22, 2006 Author Share Posted August 22, 2006 How do I make sure I have write permissions. I am not experienced with this stuff. I am only 15, and my mom set up the web site I jsut designed it. Link to comment Share on other sites More sharing options...
justsomeguy Posted August 22, 2006 Share Posted August 22, 2006 You should be able to see in the FTP program what the permissions are on the folder. Depending on the operating system of the server and the FTP client you are using, they might look like this:drwxr-xr-xThe 'd' indicates 'directory', and then there are three sets of three RWX fields. RWX are read, write, and execute. The first group of three is for the owner, the second group of three is for the owner's group, and the third is for everyone else. In the example above, the owner has read, write, and execute, the owner's group has read and execute, and everyone else has read and execute also.You can also use the chmod function in PHP to change permissions on a directory or file. But it's not a good idea to give everyone write access if you can avoid that. Link to comment Share on other sites More sharing options...
TeddyKrulewich Posted August 23, 2006 Author Share Posted August 23, 2006 I found out i can right click a directory and change the permisions. I can set it to public of i want, but i shoukd probably only set one directory to publicEDIT: changing the permisions of the directory I created ( /httpdocs/upload) doesnt do anyhting different. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now