FTP Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationFTP Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 18th, 2002, 05:44 PM
Garrett_44 Garrett_44 is offline
rubbish in javascript
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2001
Location: London
Posts: 683 Garrett_44 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 41 m 39 sec
Reputation Power: 8
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

Reply With Quote
  #2  
Old October 19th, 2002, 06:12 AM
pmm pmm is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Sep 2002
Posts: 679 pmm User rank is Sergeant (500 - 2000 Reputation Level)pmm User rank is Sergeant (500 - 2000 Reputation Level)pmm User rank is Sergeant (500 - 2000 Reputation Level)pmm User rank is Sergeant (500 - 2000 Reputation Level)pmm User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 4 Days 3 h 38 m 45 sec
Reputation Power: 13
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?

Reply With Quote
  #3  
Old October 19th, 2002, 08:45 AM
Garrett_44 Garrett_44 is offline
rubbish in javascript
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2001
Location: London
Posts: 683 Garrett_44 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 41 m 39 sec
Reputation Power: 8
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

Reply With Quote
  #4  
Old October 19th, 2002, 10:22 AM
pmm pmm is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Sep 2002
Posts: 679 pmm User rank is Sergeant (500 - 2000 Reputation Level)pmm User rank is Sergeant (500 - 2000 Reputation Level)pmm User rank is Sergeant (500 - 2000 Reputation Level)pmm User rank is Sergeant (500 - 2000 Reputation Level)pmm User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 4 Days 3 h 38 m 45 sec
Reputation Power: 13
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.

Reply With Quote
  #5  
Old October 19th, 2002, 01:48 PM
Garrett_44 Garrett_44 is offline
rubbish in javascript
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2001
Location: London
Posts: 683 Garrett_44 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 41 m 39 sec
Reputation Power: 8
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationFTP Help > mkdir() and ftp


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT