merylvingien Posted January 8, 2010 Share Posted January 8, 2010 Hey guys, i managed to get a upload file to work, and it works out ok, apart from i need to limit the file size that can be uploaded. However when i try and view the file: example: 37b55a4500f05584aef162fad0906f07.JPG I am getting an error message saying that i dont have permission to view this file... I have checked the folder permissions and also the image permissions and they check out ok. Anyone have any ideas? Link to comment https://forums.phpfreaks.com/topic/187744-upload-works-but/ Share on other sites More sharing options...
mrMarcus Posted January 8, 2010 Share Posted January 8, 2010 is the error message a browser message or PHP message? please post if a PHP message. Link to comment https://forums.phpfreaks.com/topic/187744-upload-works-but/#findComment-991219 Share on other sites More sharing options...
merylvingien Posted January 8, 2010 Author Share Posted January 8, 2010 Its a browser message: Forbidden You don't have permission to access /uploads/5df8b62128a675b0c2cc9906ec3d7d23.jpg on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. Link to comment https://forums.phpfreaks.com/topic/187744-upload-works-but/#findComment-991221 Share on other sites More sharing options...
calmchess Posted January 8, 2010 Share Posted January 8, 2010 how are you viewing the file? are you echoing it out with html?......I'd also make sure the permissions on the temporary upload folder has the correct permissions as well as the moved to folder has the correct permissions. Link to comment https://forums.phpfreaks.com/topic/187744-upload-works-but/#findComment-991238 Share on other sites More sharing options...
The Little Guy Posted January 8, 2010 Share Posted January 8, 2010 in your uploads directory make a file and name it ".htaccess" then in that file add this line: Options +Indexes Let me know if that works edit: Never mind, that is if your looking at the directory without an index and no file specified Sorry... Link to comment https://forums.phpfreaks.com/topic/187744-upload-works-but/#findComment-991239 Share on other sites More sharing options...
merylvingien Posted January 8, 2010 Author Share Posted January 8, 2010 how are you viewing the file? are you echoing it out with html?......I'd also make sure the permissions on the temporary upload folder has the correct permissions as well as the moved to folder has the correct permissions. I have tried echoing with html and viewing direct from the browser, it just seems to be a problem with that folder, if i put a index page in there i can view that but no images, even if i ftp the images into the folder. Ive tried messing about with the folder permissions etc but no joy. I have never come across this before. You mention a temporary upload folder, but there is none. Only /uploads/ The image gets put in the folder ok through the upload page. Link to comment https://forums.phpfreaks.com/topic/187744-upload-works-but/#findComment-991242 Share on other sites More sharing options...
mrMarcus Posted January 8, 2010 Share Posted January 8, 2010 what are the folder permissions and file permissions within that folder set to? 755, 777, etc? Link to comment https://forums.phpfreaks.com/topic/187744-upload-works-but/#findComment-991245 Share on other sites More sharing options...
calmchess Posted January 8, 2010 Share Posted January 8, 2010 u on windows or *.nix? Link to comment https://forums.phpfreaks.com/topic/187744-upload-works-but/#findComment-991249 Share on other sites More sharing options...
merylvingien Posted January 8, 2010 Author Share Posted January 8, 2010 The folder permissions are set to 777 and the file permissions within the folder are 644 I have tried changing them about but nout works. Its a .nix server Link to comment https://forums.phpfreaks.com/topic/187744-upload-works-but/#findComment-991250 Share on other sites More sharing options...
calmchess Posted January 8, 2010 Share Posted January 8, 2010 u sure you have your path set right to view the file if it can't find it most likely you have the wrong path..............either something like ../Images/6.jpg or http:///www.mydomain.com/Images/6.jpg Link to comment https://forums.phpfreaks.com/topic/187744-upload-works-but/#findComment-991252 Share on other sites More sharing options...
calmchess Posted January 8, 2010 Share Posted January 8, 2010 try chown too Link to comment https://forums.phpfreaks.com/topic/187744-upload-works-but/#findComment-991253 Share on other sites More sharing options...
merylvingien Posted January 8, 2010 Author Share Posted January 8, 2010 I have the correct path! I have no idea what chown means Link to comment https://forums.phpfreaks.com/topic/187744-upload-works-but/#findComment-991256 Share on other sites More sharing options...
calmchess Posted January 8, 2010 Share Posted January 8, 2010 chmod and chowin is how you set file permissions on linux and unix Link to comment https://forums.phpfreaks.com/topic/187744-upload-works-but/#findComment-991257 Share on other sites More sharing options...
mrMarcus Posted January 8, 2010 Share Posted January 8, 2010 anything in your error logs? Link to comment https://forums.phpfreaks.com/topic/187744-upload-works-but/#findComment-991259 Share on other sites More sharing options...
merylvingien Posted January 8, 2010 Author Share Posted January 8, 2010 No errors! I think i am going to have to get in touch with the hosting company, cause this is ridiculous! Link to comment https://forums.phpfreaks.com/topic/187744-upload-works-but/#findComment-991261 Share on other sites More sharing options...
merylvingien Posted January 8, 2010 Author Share Posted January 8, 2010 Is there some way that php can effect an image, becuase i have moved an uploaded image into my images folder, still cannot view it, renamed it, still cannot view it. Localy all works fine. Webhost just gave me the usual file permissions should be this etc. Link to comment https://forums.phpfreaks.com/topic/187744-upload-works-but/#findComment-991284 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.