3 Replies - 20948 Views - Last Post: 20 April 2009 - 02:54 PM Rate Topic: -----

#1 kcvontop  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 20-April 09

how can i make a folder writable in my localhost root folder

Post icon  Posted 20 April 2009 - 01:55 PM

I am a beginner in web development. please I need somebody to tell me how to make a folder writable in my local root folder so that I can upload text and images to it. I use WAMP server on windows xp and also how can I create a link to the folder in this code

$upload_path = '/ngbbs/';

$copy_to = $_SERVER['DOCUMENT_ROOT'] . $upload_path . $_FILES['data']['name'];

assuming my files are arranged like this
c://wamp/www/upload

Is This A Good Question/Topic? 0
  • +

Replies To: how can i make a folder writable in my localhost root folder

#2 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1634
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: how can i make a folder writable in my localhost root folder

Posted 20 April 2009 - 01:58 PM

Moved to PHP Forum :)
Was This Post Helpful? 0
  • +
  • -

#3 RPGonzo  Icon User is offline

  • // Note to self: hmphh .... I forgot
  • member icon

Reputation: 151
  • View blog
  • Posts: 954
  • Joined: 16-March 09

Re: how can i make a folder writable in my localhost root folder

Posted 20 April 2009 - 02:24 PM

First thing is the permissions of the folder to allow user upload needs to be 7,7,7

php can do this using chmod

<?php
chmod('c:/wamp/www/upload', 0777)
?>



or set the permissions directly on the folder so that public has write permissions , if you plan on letting them have read access as well than the 0777 should work fine ... if you want to reset the permissions when your done just change the 0777 to 0644 which is "Read and write for owner, read for everybody else"

more info on chmod Click HERE

This post has been edited by RPGonzo: 20 April 2009 - 02:33 PM

Was This Post Helpful? 0
  • +
  • -

#4 grimpirate  Icon User is offline

  • Pirate King
  • member icon

Reputation: 149
  • View blog
  • Posts: 714
  • Joined: 03-August 06

Re: how can i make a folder writable in my localhost root folder

Posted 20 April 2009 - 02:54 PM

If you're on a Windows machine chmod isn't really an issue. If its a FAT32 filesystem you should already have write permissions. In Windows its an issue of read only or or not. The chmod that RPGonzo refers to actually addresses those issues. Some in there say that 0755 and 0644 are the only two recognizable Windows chmod operations, but some say its two others. Just try and see what works for you.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1