PHP School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a PHP Expert!

Join 300,428 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 1,480 people online right now. Registration is fast and FREE... Join Now!




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

 

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

kcvontop

20 Apr, 2009 - 12:55 PM
Post #1

New D.I.C Head
*

Joined: 20 Apr, 2009
Posts: 6

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


User is offlineProfile CardPM
+Quote Post


PsychoCoder

RE: How Can I Make A Folder Writable In My Localhost Root Folder

20 Apr, 2009 - 12:58 PM
Post #2

Dyslexics Untie!
Group Icon

Joined: 26 Jul, 2007
Posts: 14,714



Thanked: 501 times
Dream Kudos: 11450
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net, jQuery

My Contributions
Moved to PHP Forum smile.gif
User is offlineProfile CardPM
+Quote Post

RPGonzo

RE: How Can I Make A Folder Writable In My Localhost Root Folder

20 Apr, 2009 - 01:24 PM
Post #3

// Note to self: hmphh .... I forgot
Group Icon

Joined: 16 Mar, 2009
Posts: 743



Thanked: 89 times
Dream Kudos: 25
My Contributions
First thing is the permissions of the folder to allow user upload needs to be 7,7,7

php can do this using chmod

CODE

<?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 Apr, 2009 - 01:33 PM
User is offlineProfile CardPM
+Quote Post

grimpirate

RE: How Can I Make A Folder Writable In My Localhost Root Folder

20 Apr, 2009 - 01:54 PM
Post #4

D.I.C Regular
Group Icon

Joined: 3 Aug, 2006
Posts: 381



Thanked: 16 times
Dream Kudos: 375
My Contributions
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.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/8/09 12:26AM

Live PHP Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

PHP Tutorials

Reference Sheets

PHP Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month