|
greenie
|
 |
« on: February 16, 2003, 11:06:00 AM » |
|
I need to be able to upload and also delete files (images) via php.
When I try to delete I get: Warning : unlink(image.jpg) [ function.unlink ]: Permission denied in /home/username/public_html/php/delete_sub.php on line 10 Line 10 is my unlink().
When I try an upload I get: Warning : copy(image.jpg) [ function.copy ]: failed to create stream: Permission denied in /home/username/public_html/php/upload_sub.php on line 10 Line 10 is my $HTTP_POST_FILES['sendImage']['name']).
How do I get the permissions changed so i can upload and delete files? I am not really Unix or CHMOD conversant.
|
|
|
|
|
Logged
|
|
|
|
|
greenie
|
 |
« Reply #1 on: February 16, 2003, 11:31:00 AM » |
|
Just found the area to change permissions in the CPanel. Changed permissions for target folder 'php' to 770.
I still get the same failure and warning when I try an upload.
|
|
|
|
|
Logged
|
|
|
|
|
greenie
|
 |
« Reply #2 on: February 17, 2003, 10:04:00 AM » |
|
Great. Over 24 hours and not a response.
I emailed support and got this reply: "the reason your unable to upload or delete files via. php is that the exec, backtic , and any command running from the command prompt has been disabled for security reasons, to execute this sucessfuly it has to been done via internal php command."
Can anyone interpret this for me? Any pointers as to what or where an "internal php command" is or examples can be found.
|
|
|
|
|
Logged
|
|
|
|
|
charle97
|
 |
« Reply #3 on: February 17, 2003, 01:44:00 PM » |
|
i wish i could help. my php knowledge starts and ends at include(). maybe you could seek some help at a php forum. the following seems promising: http://www.phpbuilder.com/board/i'm sure that there are a bunch of others. [ February 17, 2003, 09:47 PM: Message edited by: charles g ]
|
|
|
|
|
Logged
|
|
|
|
|
stephan
Guest
|
 |
« Reply #4 on: February 17, 2003, 06:02:00 PM » |
|
What script are you using?
|
|
|
|
|
Logged
|
|
|
|
|
greenie
|
 |
« Reply #5 on: February 17, 2003, 09:11:00 PM » |
|
Hi Stephan:
I'm not using any 'script'. Both the upload and delete php pages are called from a form action.
Upload is via copy($HTTP_POST_FILES['sendImage']['tmp_name'], $HTTP_POST_FILES['sendImage']['name']); and delete is via $a = $HTTP_POST_VARS['id']; unlink($a); Both of these work perfectly on servers where Safe Mode is not on.
|
|
|
|
|
Logged
|
|
|
|
|
stephan
Guest
|
 |
« Reply #6 on: February 18, 2003, 03:47:00 AM » |
|
Ok, what kind of php script (page) are you using?
PHP is a scripting language, you must be using a script.
What I need to know is the name of the php script you are using.
|
|
|
|
|
Logged
|
|
|
|
|
greenie
|
 |
« Reply #7 on: February 18, 2003, 04:47:00 PM » |
|
I guess I'm stupid but I really don't understand your question. Do you mean the name of the actual page that does the delete or upload?
Delete is named deleting.php, delete_sub.php, delete_detail.php, and delete_SPhoto.php. Each deletes items in different locations or tables. Upload is named upload_sub.php, upload_detail.php, and upload_SPhoto.php - again for different locations or tables. Ingenius names, huh? All pages are pure php except for the requisite html and body tags to hold the executable php code and are called via a form action.
|
|
|
|
|
Logged
|
|
|
|
|
stephan
Guest
|
 |
« Reply #8 on: February 18, 2003, 07:04:00 AM » |
|
Hello again,
No, you're not stupid! I am!
I didn't read your question properly.
CHMOD the target folder to 666 and try your script.
If that doesn't work, try 777, but 666 should work.
If it doesn't, please let me know.
|
|
|
|
|
Logged
|
|
|
|
|
greenie
|
 |
« Reply #9 on: February 18, 2003, 07:05:00 AM » |
|
Just received an email from support stating "The "copy" function is an active function on our server".
Everything now works. Thank you!
Stephan, if you had an idea of some way to work around the previous problem I would still be interested to hear it.
|
|
|
|
|
Logged
|
|
|
|
|
greenie
|
 |
« Reply #10 on: February 18, 2003, 07:07:00 AM » |
|
I read up on permissions and decided 777 was what I needed. I changed it yesterday but it did no good. With the 'copy' function enabled, though, I am sure that the world permissions were necessary.
|
|
|
|
|
Logged
|
|
|
|
|