Im having a problem with permissions and uploading a file to a directory on a server.
my server is apache and is local.
How do I set a dirertory World Writeable or change the permissions on my local server?
Im having a problem with permissions and uploading a file to a directory on a server.
my server is apache and is local.
How do I set a dirertory World Writeable or change the permissions on my local server?
are you running linux or windows? it might make a difference.
use ftp and look for the “chmod” command, set the permissions to 777, thats world writable, readable and executable.
Forgive my imcompotence, but I dont understand what you mean. Is this command in the folder or in a seperate file? Where do I look? Please help, I have searched everywhere on the web and cant find the awnser.
This is a windows machine.
windows doesnt have permissions in that sense…
Why dont you tell us what youre trying to achieve instead?
you can check the other thread where i already answered your question, but to make a directory world-writeable in windows, you’ll have to (in windows explorer) right click on the directory, choose “properties”, and uncheck the checkbox that corresponds to “Read-only”
What im trying to do is upload a file to the web server. It is a local server and is apache. Running on win XP home
$filename = 'http://localhost/images/' .time() .
$_SERVER['REMOTE_ADDR'] . $extention;
if (is_uploaded_file($_FILES['upload']['tmp_name']) and
copy($_FILES['upload']['tmp_name'], $filename)) {
echo "<p>File uploaded Just as $filename.</p>";
} else {
echo "<p>Could not save the file as $filename!<?p>";
}
If i change the vairable $filename to
$filename = 'C:xampp/htdocs/images' .time() .
$_SERVER['REMOTE_ADDR'] . $extention;
if (is_uploaded_file($_FILES['upload']['tmp_name']) and
copy($_FILES['upload']['tmp_name'], $filename)) {
echo "<p>File uploaded Just as $filename.</p>";
} else {
echo "<p>Could not save the file as $filename!<?p>";
}
Then Everything goes great. Even though is is the same place.
ps. I did find where to change the cmhod but it will not let me make the changes via the FTP. Im assuming that is because it is windows.
Hope this helps, Thank you very much everyone for all your help so far.
And why again can’t you use the second piece of code you listed? You cannot upload a file to a “url”.
I have tried to (in windows explorer) to uncheck the box that corresponds to the “read only” Click apply then click ok. But, then if I open the properties on the folder again the box is re checked and states that the folder is “read only”
I am currently doing testing. But in the future when the site is running on a real live server for everyone to use, I want to be able to upload files to the web server. When that is the case i need the file to be accessible from anywhere.
Should I just store the file in a database. I will be uploading about 8 images per day and I think that might not be so good to do to the database.
OHHHHHHHH i get it now.
When you upload a file to the server you use the “c:\sdfs\asdfa\” name. When you want to access it from a website or something you use the “http://webservername/sdfs/asdfa/” link to it.
Or…
Are you saying that the file isn’t uploaded to the folder you specified? If this is the case, you might have to go into the “advanced” settings of the permissions and uncheck the box that says “folder inherits permissions from parent” or something like that.
I got it figured out.
I just had too much info. All i need is " images/ " rather than http://localhost/images
Thanks to everyone for all your help in this matter. I appreciate if very much. Have a great night…
Chris