Jump to content
Larry Ullman's Book Forums

Chapter 10 Script 10.3 Upload_Image - Image Only Goes To Website 'htdocs' Folder On

Recommended Posts



In chapter 10,script 10.3 Upload_Image. I get the message The file has been uploaded! even when I can't see the file in the 'uploads' folder I added to the website.


If I replace ../uploads/ with ../htdocs/ in the script the image appears in the website 'htdocs' folder - great, at least the script is working as expected there.


I can create folders alongside the htdocs one in my webspace but I can't change the properties of them - although they all seem to have the same (htdocs and uploads for example).


My web host is Fasthosts.


I see on the forum there have been similar questions, but with no conclusions.


I suspect this is more of a web host issue than a php one, but it would be nice to know for sure and if there is a way round it.





Link to comment
Share on other sites

The reason there are no conclusions on this issue is that everyone's setup is different. Replacing ../uploads/ with ../htdocs/, for example, makes absolutely no sense unless you've done something different with your paths. I would start by picking one approach and going with it. I would either try to use the "uploads" folder OUTSIDE of the web root or create one WITHIN the web root. Then you'd need to set the upload path to point to it accordingly. 


PHP would not give the message that the file was uploaded unless it was uploaded. So something else may be going on. I'd make sure display_errors is enabled and that your code is pointing to the right destination directory. 

Link to comment
Share on other sites


  • Create New...