File Permissions After Copy()
This function basically creates a new dir in a determined location and copies the files from an established dir to the new dir. It copies the files and creates the folder ok, bit it sets the file permissons to 755 for the new folder and file contents. I then get a 550 error if I try to delete or chmod them. Any suggestions? I get permission errors in the script if I use the chgrp and chmod functions also. PHP Code:
View Complete Forum Thread with Replies
Related Forum Messages:
Copy() Win2k Permissions Problem
Hello hello. I'm growing grey hairs with this one. Bassicaly, a script builds a bunch of folders (this works) then tries to copy files into new folders (this doesn't). I use PHP4, win2k, Apache 1.3, MySQL. The error is Permission Denied. Sounds like a win2k chmod issue but can't figure it out. Code is as follows: $real_path = realpath (""); umask(011); mkdir("$real_pathsites$sitename", 666); mkdir("$real_pathsites$sitenameimages", 666); mkdir("$real_pathsites$sitenamecss", 666); mkdir("$real_pathsites$sitenamejscript", 666); chmod ("$real_path/sites", 666); chmod ("$real_path/templates/", 666); chmod ("$real_path/templates/css.css", 666); $copy_from = "templates/css.css"; $copy_to = "sites$sitename/css"; copy($copy_to, $copy_from) or die("Couldn't copy file.");
View Replies !
Copy A Directory With Security Permissions
I am trying to make a page that will accept input from a user and create a directory structure from the input then fill that directory with the contents of a template directory and put the correct permissions back to the folders. This is on windows 2k server using active directory. a small sample of what I am trying to do: Code:
View Replies !
File Permissions
Im in the process of creating a web based frontend for a program called ASK (Active Spam Killer - http://a-s-k.sourceforge.net) and am currently running into a problem. Currently there is a perl based web front end, but it lacks functionality, and is rather bland, although it does work, and it works without changing any file permissions. The problem im running into is that PHP requires me to make changes to file permissions (ASK files are located OUTSIDE of the web tree) which might end up causing problems as far as security and privacy of email. Has anyone come to any reasonable answer for this type of problem as im sure its a issue for other programs people write.
View Replies !
File Permissions....
I've read the stuff concerning writing to a text file and the related file permission issues on this forum.I have a script that does just that, it takes user-entered data from a Web Form and dumps it to a text file on a server. This works fine on my private server, but is giving me the error...."Could not open stream.Permission denied on Line..." on the company server...The Company machine uses Windows XP. I've tried talking to the System Administrator regarding the Permissions,but he says that giving READ/WRITE/EXECUTE Permissions could create Security Issues. I have been told that previously,a script written in ASP had been used that did exactly the same thing i.e writing to the text file, but there were no File Permissions needed to be set!
View Replies !
Problem With File Permissions : PHP / FTP
My php-script makes directories and puts files in it. But via FTP'ing, I can't delete those files anymore. Also, I need to put a whole bunch of existing files into these, 'made-by-php' directories, and that seems impossible by means of FTP. I get an 'access denied' error every time.
View Replies !
File Permissions In Win98
I just wanted to know if there was any way I could change my file permissions so I can use the fopen function in windows 98 using Apache and PHP 4.04???? I know how to do it for Linux but I need it for Win 98.
View Replies !
Change File Permissions
i'm trying to create a file management tool online using php. Everytime i copy or create files or folders though it assigns ownership of the new files or folders to the apache id. i tried using backticks, exec, shell_exec and the php shell commands. php safe mode is off. i can create the files and folders using shell commands and have tried to change ownership using chown but that doesn't seem to do anything. any insight can help. the goal is to be able to create these files with the same admin user ownership as all the other files on the site.
View Replies !
CHMOD File Permissions
i have a few question about file permissions. which is the best way to set a permission to a mp3 tha ti can play on the website, but if anyone try to get it from the directory they wont be able to? like if i am playing thissong.mp3 and someone went to the directory to try and get the file music/songs/thissong.mp3 they would get some kind of error. also for folders that don't have a index file. which permission would be the bes tinstead of creating a number of index for each, but not give a use permusic to see the context if the go to mydirectory/functions/ .
View Replies !
File/folder Permissions
I have an upload function that uploads images into a folder. The folder is set to 777. However when I upload an image file to the folder, the file uploaded is set to 600. Therefore it wont appear on web. I'm not sure why this is doing this for?? Im using the php function move_uploaded_file to upload the file.
View Replies !
File Write Permissions
I'm trying to get an open source PHP app working for my company. It's giving me the following custom error: FreeMED was unable to create a file to record the healthy status of the system. The FreeMED directory should be owned by the user that the webserver is running as... Usually this is 'apache'. You can also fix this by giving universal write access to the home directory of FreeMED. But that is not advisable from a security standpoint. I've narrowed it down to the line of PHP that's breaking it here: $test = CreateObject('FreeMED.FreeMEDSelfTest'); As far as I can tell, I've made the directory it's using as open as possible and it's still giving me that error. The owner is apache (user and group) and the permissions are (temporarily) set at 0777 (universal read/write). Is there some PHP or Apache configuration that needs changed to allow PHP this kind of permission?
View Replies !
File Permissions Windows
i am using the LOAD DATA INFILE to load from a txt file. Although it works fine with the MySQL command it does NOT work with Script...does anybody know why?
View Replies !
File Permissions On Upload
I am uploading picture. This is part of the code if(!move_uploaded_file($_FILES['fullSizePic'.$propId.$i]['tmp_name'], '../images/properties/'.$imageName) ){ chmod('../images/properties/' . $imageName , 0777); } The file uploads and moves into the properties folder. That folder's chmod is 777, but the file's chmod is only 600 making it unreadable by the server. I try to chmod it with php (as you can see above) and it doesn't work.
View Replies !
Not Enough Permissions To Delete A File
I want to delete a file using unlink() function. I'm getting a warning that says that I have no permissions to do that. I suppose that is because the file I'm trying to delete is under the root directory path. I searched the forum about deleting files but found nothing alike my problem...
View Replies !
Upload File Permissions Problem
I've moved an existing site (which I didn't write) from a apache/php/mysql host under windows to a linux apache/php/mysql host. I've sorted out most problems except one. There is an upload function on the site, which uploads files via POST to temp folder and then moves it into a folder on the host using php function move_uploaded_file. Under windows this works fine but on the linux host the uploaded file is created with 600 permissions so it cannot be accessed later by site visitors. The folder it is uploaded into has 755 permissions. Is there a way of setting the default file permissions so each uploaded file can be set to say 644 or do I need to chmod each file after upload?
View Replies !
File Permissions Of PHP Session Files
I noticed that the file permissions (unix) of the PHP session files have only read and write permissions for the Apache process (600 or rw- --- ---). Does anyone have any idea where this permission is set ? I can't find any umask or chmod settings for it in the php.ini file. Can't find anything in the httpd.conf either. Is it set in the PHP code that implements session_start()?
View Replies !
Creating A File, Uploading, And Permissions
I'm using php4 and i want to check for a file, if it doesn't exist it should be created. My problem is i have to create it with specific permissions specifically 666 so that the script can then write to it. I don't have ftp access. I'm also looking for any tutorials, recent ones, using php4 for creating file upload areas, i'm trying to make one of those as well.
View Replies !
File And Directory Permissions For PHP Application
I make the directory 0777 and then write the file then i make the file i tried a few but they keep from being read im sure the file is ok i think i can handdle file permissions but i think its directory permissions im having a prob with. Its an image file i write it and then need to use it so make the directory 0777 and then write the file and then what to the file and what to the directory ? i am using php ftp() but if anyone knows any differences with php chmod() then please tell me apart from that i do a 777 righth now and leave it at that. what should i being to the directory and file after to make it secure because i dont whant people tampering with them ? OH AND THIS PROBS ON TH MAC OSX 10.4 TIGER my chmoding works fine on linux the way it is 0777 and then a 655 + somtimes i play with the permissions of the directory throgh the os GUI or the shell and i got it to tell me i dont have permissions in the OS but in PHP its ok is this coz PHP got ownership of it when i messed with the addtional BIT.
View Replies !
File Permissions Denied Error
i'm using the following code to create a file. PHP Code: $fn = "file.php"; $FileHandle = fopen($fn, 'w+') or die("can't open file"); $stringData = "Something"; fwrite($FileHandle, $stringData); fclose($FileHandle); when i check the file properties i can see that the file's permission is set to 644 so when i use the following code to delete it i get a permission denied error. PHP Code: $myFile = "file.php"; $fh = fopen($myFile, 'w') or die("can't open file"); fclose($fh); $myFile = "$file.php"; unlink($myFile); what shall i do to set the permission to 777 when creating the file?
View Replies !
Chmod Mkdir And File Permissions..
I'm trying to create directories and move files with the right permissions. When I make a dir using mkdir I'm setting the permission to 777 to my folder variable $t2 below, but when I check the chmod it's 755? When I copy files over to this folder the file permission are set to 644 and I can't even get rid of them on the server because it won't allow me to delete them. Is there anyway to set permissions to a file as you're using the copy function? Code:
View Replies !
Set Up The Permissions So That My Script Can Simply Fopen A File For Writing.
I am rather new to PHP and a relative newbie to Linux too. I have a webserver at home (Apache 2.0.48 on SuSe 9.0, PHP4). I have some scripts, one of them needs to be able to create logfiles somewhere on my machine. It must also later be able to read from and write to these files again. Sofar I get a permission error. I tried chmodding 666 or 777 the directory in which the files could reside, to no avail. How do I set up the permissions so that my script can simply fopen a file for writing. Or if that's not the issue, what am I doing wrong or overlooking ? The errors: Warning: fopen(logfileslog1.txt): failed to open stream: Permission denied in script1.php on line 142 Warning: fwrite(): supplied argument is not a valid stream resource in script1.php on line 154 Warning: fclose(): supplied argument is not a valid stream resource in script1.php on line 161 It's the first I am puzzled about, the 2nd and 3rd are a logical consequence. By the way, reading from and writing to a file I have previously created myself with exactly the names I tried to get created by the script (echoed the name, ok) is no problem at all. So I don't think it has much to do with a safemode or open_basedir setting. I also tried creating the scripts in the same dir the script itself resides. Did not work either.
View Replies !
Linux File Permissions On Maildir, Apache User
i have the following problem. I am trying to create maildir directories on the local filesystem then chmod, chown them to courier:courier (for courier mail server). the courier mail server reads and writes on these maildirs on the local filesystem and they need to have courier:courier ownership. it does not work because the directories are created with apache:apache ownership and apparently only root can change ownership. My question is as follows. Is the only solution to this problem to add the courier user to the apache group?
View Replies !
Open A File To Store Some Date :: Permissions Dilemma
I want to open a file to store some data. However, when I use fopen('filename', w) I get permission denied. So, I've changed the permissions of the directory to get rid of the permission denied problem. Unfortunately, this seemed to require changing the directory to have permissions 777.
View Replies !
Copy A File From A Different Url
Hi I am trying to copy a file froma different url but failing! I am trying - copy ("http://www.site.com/image.jpg" , "temp.jpg"); but getting an ' Unable to open 'http://www.olgaedwards.com/photos/2041.jpg' for reading: No such file or directory' error. Strange because it exists and - $file = fopen("http://www.site.com/image.jpg" , "rb"); works ok! I even tried - $file = fopen("http://www.site.com/image.jpg" , "rb"); copy ($file , "temp.jp"); But the same error.
View Replies !
Copy A File With PHP
Im trying to copy a file from the root of my website to other folder.. $source='/home/content/maunalava/html/dev-netteampr/portales/index.php'; $destination=('/home/content/maunalava/html/dev-netteampr/portales/' . $usuario); copy($source, $destination); But I keep getting...failed to open stream: Is a directory in....
View Replies !
Copy A File To The Server
is it possible to copy a certain given file from a set location to the server everytime the page is accessed? I have to build a site wehere daily new information has to uploaded to an intranet server, like new exchange rates. therefore i want to build a script that automaticaly uploads a csv-file to the server whenever it is accessed. the file that has to uploaded resides(and is updated) an a certain machine on the lan. is this possible? and how would you do it? PHP Code:
View Replies !
Copy($file, $address)
trying to use copy($file, $address) and it throws this back at me... Warning: open_basedir restriction in effect. File is in wrong >directory >in /home/sites/site170/web/admin/experiments/uploader.php on line 57 is this a permissions problem?
View Replies !
Copy Of Zlib File
I goofed up my linux beater box at home and I need to reinstall. It seems that zlib is located at http://www.zlib.net, but that site isn't working. I was wondering if someone has a recent release they could e-mail.
View Replies !
File Upload And Copy()
I just just got a html/php file upload to work using the copy function, but copy() still returns false and prints the error message saying that the upload failed. It returns false even though the file has already been uploaded to the correct place. Here is my code: if (!copy($userfile,"$newfile")) { print "Error Uploading File."; exit();}
View Replies !
File Copy Error
Here's a piece of code I'm running on my server though I keep getting the following error. I'm not too sure what might be the issue, however, I have the permissions set properly - though I doubt if I'm using the right folder paths. Cheers and regards, The Code:
View Replies !
Copy File From One Server To Another
How can I copy a file(s) from my server to another server? I trying to keep files on a develpment server current with a production servers files. So if i have files "a", "b", "c" on the production server, and files "b", "c" on the develpment server, i want to copy "a" from the production server. Is this possible? Also is it possible to upload a file to several destinations?
View Replies !
Using PHP To Copy A File Over The Network
im using IIS and php 4, im trying to write a bit of code that will cope a file from 1 network location to another i have tried 2 methods using the copy command, the first is mapping the network location onto the webserver then going copy('x:example',... etc the other method is using UNC paths, both work fine if i call the php script from the command line like c:phpphp.exe c:myscript.php this works fine but from a browser i just get file cannot be found, i have tried setting setting various permissions on the destination server, tried changing the IUSR_ account to a domain account etc,
View Replies !
Copy File Issue
Why does the below fail to create a copy of the template.php page? I want to assign the copy a new name and save it. Below gives the error : failed to copy template.php. Where am I going wrong? PHP Code: $file = 'template.php' //TEMPLATE             echo $newfile = $title.'.php' // COPY             // copy over files             if (!copy($file, $newfile)) {                   echo "failed to copy $file... ";             }             else             {                    echo 'File Created.'
View Replies !
Copy Image File
i would need help with creating some cURL code: $old_file = "http://my_host.com/images/test.jpg"; $new_destination = "http://some_other_host.com/archived_images"; i was trying to create a cURL code that would copy the $old_file to a $new_destination but did not have much success. basicaly i need to copy the file to the new server and if succedded, delete the original on old server. give me a hint with this?
View Replies !
Copy File On FTP Server
Have a set of files on FTP server in a folder. I need a script that: - logins to ftp server - copy a file from one folder to another - the filename is received from the URL string in the fname parameter - rename the copied file to some random 10-digit-string (alphanumeric) (e.g. from XYZ.rm to hgy5ubae30.rm) - serve the file to the user - before the script runs, the temp folder should be cleared out - if there are files currently opened, the error should be handled properly and continue with the rest of the script (eventually after this script is run several times, those undeleted files will be deleted) The files are all named some_filename.rm, in the videos folder. They are served to the user as rtsp://mysite.com/tempvid/filename.rm - they should be copied to a folder called tempvid and served from there.
View Replies !
Copy A File On Folder
I have a script that creates a folder in my site when someone registers. I need a file that is stored on my site to be copied into this newly created folder every time a folder is created. I also need a new empty folder to be created in this folder with a standard name. So, when someone registeres on my site, I have a script that creates an ftp account and folder on my site for them using the info they provided, but what I need is a file copied to that folder and a sub folder created.
View Replies !
File Copy Function
I'm looking for a command such as the unix/linux cp command... I have some a couple of directorys and text files and some images on a server and want to move the whole tree to another directory... i know the copy can copy the contents of a text file and put it in another one however I'm after something that will copy entire folders/files/images to another directory without using FTP.
View Replies !
Copy() File To New Directory
I'm trying to create a php script that will copy a file from my build directory to another directory. I've been trying the copy() function without luck. Here's what I've tried: $source_file = '../build/index.php' $dest_file = '../prod/index.php' copy($source_file, $dest_file);
View Replies !
Copy The Content From A File?
Is it possible to do this? 1) Upload a PHP (or txt, html) file Using HTML forms <input type="file" name="data_file" size="40"> 2) Once the user uploads the file it reads and copies the files contents 3) Once the contents of the file is copied it submits it to a database. I know how to do 1 and 3 but am not sure if #2 is even possible.
View Replies !
Copy File From Email Attachment
I want to retrieve mail and save the attachment from it on my server. That works pretty well until the image copy. With the code below I can see the image in my webbrowser. But how can I copy it to my /files directory? PHP Code:
View Replies !
Progress Indicator - FTP / File Copy?
I'm wondering if anyone has come up with a way to give a web user info about a filesystem or FTP transaction while it's in progress. My site deals with hi-res MPEG files (i.e. 20 - 200MB) and so wait times are significant. Here are the two cases that I'm specifically interested in: - My site allows the user to copy an MPEG file from a 'hosting' PC to a 'playout' PC. I'd like to be able to give the user a rough idea of how the copy is progressing (even if it's not 100% accurate). - The site also allows the user to download an MPEG file from a remote FTP site for local layout. Here again, I'd like to be able to follow the FTP download while it's happening.
View Replies !
|