|
|
|
|
![]() ![]() |
![]() Group: Members
Posts: 0 Joined: 8-December 06 Member No.: 34,877 |
Post
#1
Dec 8 2006, 01:46 AM
How can i allow for people to upload images from my site to another path? When i made the script i get this error QUOTE Warning: move_uploaded_file(uploads/38120806topic_split.gif): failed to open stream: Permission denied in /home/ninjach/public_html/upload.php on line 26
Warning: move_uploaded_file(): Unable to move '/tmp/phpQyLuQt' to 'uploads/38120806topic_split.gif' in /home/ninjach/public_html/upload.php on line 26 |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Admin
Posts: 3,696 Joined: 23-April 05 From: Trap17 storage box Member No.: 6,042 myCENT:19.60 |
Post
#2
Dec 8 2006, 01:55 AM
It would be nice if you posted your source code...? Otherwise it's all in the speculation. And note the QUOTE bbcode tag I added? |
![]() Group: Members
Posts: 0 Joined: 8-December 06 Member No.: 34,877 |
Post
#3
Dec 8 2006, 02:07 AM
CODE if(!isset($_POST['upload'])) {
echo ' <form name="upload" enctype="multipart/form-data" method="POST" action="'.$_SERVER['REQUEST_URI'].'"> <input type="file" name="file" size="13" value=""> <br /><input type="submit" name="upload" value="Upload"> </form> '; } else { if( ($_FILES["file"]["type"] == "image/gif") || ($_FILES["file"]["type"] == "image/jpeg") || ($_FILES["file"]["type"] == "image/png") || ($_FILES["file"]["type"] == "image/jpg") ){ $uploaddir = 'uploads/'; $filename = $_FILES['file']['name']; $filesize = $_FILES['file']['size']; $tmpname_file = $_FILES['file']['tmp_name']; $date_file = date(imdy); move_uploaded_file($tmpname_file, "$uploaddir$date_file$filename"); //Connection MySQL //Select DB //update MySQL }else{ echo"Invalid file type."; } } |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [MODERATOR]
Posts: 4,433 Joined: 24-July 05 From: Linix, DOS and Windows…the good, the bad and the ugly Member No.: 9,787 ![]() myCENT:74.90 |
Post
#4
Dec 8 2006, 03:12 AM
In your cpanel, chmod the permissions on the temporary directory and the uploads directory to 777.
|
![]() ![]() Group: Members
Posts: 29 Joined: 6-December 06 Member No.: 34,788 |
Post
#5
Dec 8 2006, 05:40 AM
Try to use "copy" function instead of "move". And remember that your file .php must have permission to create files. I hope it will help. |
![]() Group: Members
Posts: 0 Joined: 8-December 06 Member No.: 34,877 |
Post
#6
Dec 8 2006, 06:06 AM
I got the problem solved thank you everyone
This post has been edited by Dennis56: Dec 8 2006, 06:12 AM |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Admin
Posts: 3,696 Joined: 23-April 05 From: Trap17 storage box Member No.: 6,042 myCENT:19.60 |
Post
#7
Dec 8 2006, 06:10 AM
You can do two ways: 1) access your cPanel, click on the folder (not the folder icon) you're trying to change mode, right hand menu "change permission." This is done through File Manager. 2) using your FTP software, right click on the folder and select the permission or chmod menu. This is different from which FTP software you're using. |
![]() ![]() |
Similar Topics
| Topic Title | Replies | Topic Starter | Views | Last Action | |||
|---|---|---|---|---|---|---|---|
![]() |
0 | noxit | 2,524 | 20th June 2004 - 02:06 PM Last post by: noxit |
|||
![]() |
8 | -Pandemonium- | 641 | 25th August 2004 - 04:00 PM Last post by: -Pandemonium- |
|||
![]() |
4 | BoSZ | 543 | 17th December 2008 - 05:15 PM Last post by: buxgoddess |
|||
![]() |
2 | Eric Straven | 388 | 8th September 2004 - 02:57 PM Last post by: ZorBiX |
|||
![]() |
6 | dozen | 352 | 9th September 2004 - 11:58 PM Last post by: Triple X |
|||
![]() |
4 | annylei | 371 | 14th September 2004 - 09:38 PM Last post by: Triple X |
|||
![]() |
9 | jailbox | 410 | 10th October 2004 - 08:01 AM Last post by: whatknows |
|||
![]() |
0 | anwiii | 674 | 14th June 2006 - 08:44 AM Last post by: anwiii |
|||
![]() |
2 | Inty | 384 | 3rd October 2004 - 11:17 AM Last post by: mobileunlocking |
|||
![]() |
5 | -prodigy- | 354 | 6th October 2004 - 06:37 AM Last post by: -prodigy- |
|||
![]() |
3 | josh_sg1 | 419 | 12th October 2004 - 12:02 AM Last post by: s2city |
|||
![]() |
3 | s2city | 394 | 10th October 2004 - 07:44 PM Last post by: s2city |
|||
![]() |
8 | sohahm | 399 | 21st October 2004 - 08:44 PM Last post by: beg4mercy |
|||
![]() |
0 | sohahm | 254 | 16th October 2004 - 01:46 AM Last post by: sohahm |
|||
![]() |
12 | Lyon | 2,183 | 29th April 2006 - 10:27 PM Last post by: netsevdam |
|||
|
Open Discussion | Time is now: 8th January 2009 - 09:16 AM |