|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
mkdir() and ftp
hello
i've had this problem before but never seem to get it solved. bascially i have a system that creates a folder on my server and can upload files to it. the folder is created like so... mkdir ("../../works/$work_id", 0777); where $work_id is a unique number hence always creating a unique folder. this all works fine but from time to time i need to go to the folder via ftp to modify things. i seem to be able to delete files via ftp but not download files? i suspect my problem is the 0777 but am not sure? any ideas? gar |
|
#2
|
|||
|
|||
|
Deleting files requires write permissions in the directory, which you have. But I assume the files in there are created by your script, so they will be owned by whatever user your scripts run as, eg. httpd, or www. Maybe you would have to modify your script to change the permissions or ownership of the files when they're created?
|
|
#3
|
|||
|
|||
|
yes correct its an upload script on the site which puts the files in the directory and on checking again it seems the permission problem is on the file not the directory, the files are uploaded like so...
$address = "../../works/".$work_id."/".$file_name; move_uploaded_file($file, $address) or die("problem"); $work_id is the unique number of the folder, $file_name the name of the file and $file obviously the file, so how do i upload the file with the correct permissions? a+ gar |
|
#4
|
|||
|
|||
|
Hi,
move_uploaded_file($file, $address); chmod($address, 0644); should allow you to download the file. if you want to write over it, chmod to 0666 instead. |
|
#5
|
|||
|
|||
|
yep i'm using 0777 now which seems to work fine for uploading downloading and deleting the file via ftp, still can't change the permissions on the file via ftp though!
a+ gar |
![]() |
| Viewing: Dev Shed Forums > System Administration > FTP Help > mkdir() and ftp |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|