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
3 Replies - 18074 Views - Last Post: 20 April 2009 - 02:54 PM
#1
how can i make a folder writable in my localhost root folder
Posted 20 April 2009 - 01:55 PM
Replies To: how can i make a folder writable in my localhost root folder
#2
Re: how can i make a folder writable in my localhost root folder
Posted 20 April 2009 - 01:58 PM
Moved to PHP Forum
#3
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
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
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
#4
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.
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote




|