saint Posted June 9, 2007 Share Posted June 9, 2007 Problem: I am trying to add a flash file and it's associated thumbnail. Every time I do, the thumbnail does not show up properly. Instead, it _was_ showing the outline of a image that could not be retrieved. Now, the image doesn't even show up. I have discovered it was a permission problem. The thumbnail image was chmoded -rw-------. So the system is trying to retrieve and show that image, but due to the permission, isn't viewable by the public. The following are snippets of code. I have tried to add in the line to chmod the permission to 0755 just to see if (1) that would bring back the imaged outline again and (2) if it could re-display it properly. It doesn't work and I have no idea why. If you can help or need any additional information, please let me know. Thanks in advance. //uploading primary thumbnails. if(is_uploaded_file($_FILES["thumb0"]['tmp_name'])) { $m_image0 = $m_get_max.'0.jpg'; $uploaddir = '../thumbs/'; move_uploaded_file($_FILES["thumb0"]['tmp_name'],$uploaddir.'/'.$m_image0); chmod($uploaddir.'/'.$m_image0, 0755); } Where... $m_get_max is... //get the maximum number of the user in company add table $sql_get_max = "select max(Index_id) as max_no from $table_name_in_db"; $a_get_max = mysql_fetch_array(mysql_query($sql_get_max)); $m_get_max = $a_get_max['max_no']; // maximum no of the table $m_get_max++; //increment by one Quote Link to comment Share on other sites More sharing options...
saint Posted June 9, 2007 Author Share Posted June 9, 2007 Anyone? ??? Quote Link to comment Share on other sites More sharing options...
jscix Posted June 9, 2007 Share Posted June 9, 2007 What are the permissions for the folder your uploading TO ? Quote Link to comment Share on other sites More sharing options...
jscix Posted June 9, 2007 Share Posted June 9, 2007 I don't see a problem with your code. so, if the directory has the correct settings and it still doesnt work, try writing a small script to chmod some random file. Does that work? Found this on php.net: "Note: The current user is the user under which PHP runs. It is probably not the same user you use for normal shell or FTP access. The mode can be changed only by user who owns the file on most systems." Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.