Jump to content

Recommended Posts

I'm not sure if this is the right place to put this query, but I have an issue in XAMPP under Windows.

 

I have defined HOST_WWW_ROOT in the app_config.php file as my "/htdocs/" folder and then I have defined the upload directory as HOST_WWW_ROOT . "training/uploads/pics/" and when I try to use my webform to upload, I get the following error message permissions or related error moving file to /htdocs/training/uploads/pics/imagename.JPG.

 

With a little messing around I have been able to set the HOST_WWW_ROOT as "/XAMPP/" and then defined the upload directory as HOST_WWW_ROOT . "uploads/pics/" and the code then works fine. The problem being that for training purposes I can't access the files through the browser if I upload them to that location.

 

Can anyone help advise me where I've gone wrong with this and where I can change the folder permissions for htdocs so that I can use the original specified location to upload my webform pics too.

 

Thanks

folder permissions would be set in the operating system, which with xamppp will either be windows or MacOS. For windows right click on the folder that you want to upload to and, assuming you are an admin level user, choose properties from the context menu. From here click on the security tab and then click on the advanced button followed by the Change Permissions Button and then the Add Button. In the large box in the bottom half od the prompt that comes up (should be the default focus for the cursor) type the word Everyone and click OK. Put a tick in the left hand Full Control checkbox in the list that comes up (headed Allow) and click OK. Now OK/Apply/Finish back to the explorer and your folder is now open to Everyone.

What I notice is that you said the path was set to /htdocs, not ~/htdocs or something like that. If that is indeed the case, then that is your problem: You're trying to add files to a folder on the root of your file system, a folder I'm pretty sure does not exist.

Remember, your home folder is not your system's root folder. ;)

Thanks both for those replies. I have set permissions to EVERYONE but that hasn't negated the error and I've tried changing the root folder to everything I can think of, but while I am trying to upload files to a location within the htdocs folder, I am getting the error message mentioned earlier. As I said, if I place the HOST_WWW_ROOT as xampp and then create uploads/pics/ (making the path /XAMPP/uploads/pics/ then it works fine, but i can't retrieve it using the path.

 

I assume it must be a setting within PHP and xampp but I have no idea where I would look for it to change the permissions.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.