Jump to content

cc 3.0 unable to add images help


Guest

Recommended Posts

this is what keeps coming up any one help me please

Warning: move_uploaded_file(/home/yamaha/public_html/images/uploads/fc002.JPG): failed to open stream: Permission denied in /home/yamaha/public_html/admin/filemanager/upload.php on line 96

Warning: move_uploaded_file(): Unable to move '/tmp/phpTo0CoM' to '/home/yamaha/public_html/images/uploads/fc002.JPG' in /home/yamaha/public_html/admin/filemanager/upload.php on line 96

and this is my file i havent changed a thing yet just uploaded vesrsion 3 damn not good

<?php

/*

* FCKeditor - The text editor for internet

* Copyright © 2003-2004 Frederico Caldeira Knabben

*

* Licensed under the terms of the GNU Lesser General Public License

* (http://www.opensource.org/licenses/lgpl-license.php)

*

* For further information go to http://www.fredck.com/admin/includes/rte/

* or contact [email protected].

*

* upload.php: Basic file upload manager for the editor. You have

* to have set a directory called "userimages" in the root folder

* of your web site.

*

* Authors:

* Frederic TYNDIUK (http://www.ftls.org/ - tyndiuk[at]ftls.org)

* Modded by:

* Alistair Brookbanks Devellion Limited

*/

// Init var :

include("../../includes/global.inc.php");

include("../../classes/db.inc.php");

$db = new db();

include_once("../../includes/functions.inc.php");

$config = fetchDbConfig("config");

include_once("../../language/".$config['defaultLang']."/lang.inc.php");

$enableSSl = 1;

include_once("../../includes/sslSwitch.inc.php");

include("../../classes/gd.inc.php");

// End int var

?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >

<HTML>

<HEAD>

<TITLE><?php echo $lang['admin']['filemanager']['file_uploader']; ?></TITLE>

<LINK rel="stylesheet" type="text/css" href="../includes/rte/css/fck_dialog.css">

<LINK rel="stylesheet" type="text/css" href="../styles/style.css">

</HEAD>

<BODY>

<p class="pageTitle"><?php echo $lang['admin']['filemanager']['upload_image']; ?></p>

<?php if($_GET["custom"]==1){ ?>

<form action="<?php echo $GLOBALS['rootRel'];?>admin/filemanager/upload.php" method="post" enctype="multipart/form-data" target="_self">

<table align="center" border="0" cellpadding="3" cellspacing="0" class="mainTable">

<tr>

<td class="tdTitle"><?php echo $lang['admin']['filemanager']['please_browse_img']; ?></td>

</tr>

<tr>

<td><input name="FCKeditor_File" type="file" class="textbox"></td>

</tr>

<tr>

<td align="center"><input name="submit" type="submit" class="submit" value="<?php echo $lang['admin']['filemanager']['upload_image']; ?>"></td>

</tr>

</table>

<?php if(isset($_GET['redir'])){ ?>

<input type="hidden" value="0" name="redir">

<?php } ?>

<input type="hidden" value="1" name="custom">

</form>

<?php } else { ?>

<form>

<TABLE>

<TR>

<TD>

<span class="copyText">

<?php

if($HTTP_POST_FILES['FCKeditor_File']['size'] > $config['maxImageUploadSize']) {

echo sprintf($lang['admin']['filemanager']['file_too_big'],$HTTP_POST_FILES['FCKeditor_File']['name'],format_size($config['maxImageUploadSize']));

unlink($HTTP_POST_FILES['FCKeditor_File']['tmp_name']);

} elseif (file_exists($GLOBALS['rootDir']."/images/uploads/".$HTTP_POST_FILES['FCKeditor_File']['name'])) {

echo sprintf($lang['admin']['filemanager']['img_already_exists'],$HTTP_POST_FILES['FCKeditor_File']['name']);

} elseif (!is_uploaded_file($HTTP_POST_FILES['FCKeditor_File']['tmp_name'])) {

echo $lang['admin']['filemanager']['upload_too_large'];

} elseif ($HTTP_POST_FILES['FCKeditor_File']['type'] != "image/jpeg" AND $HTTP_POST_FILES['FCKeditor_File']['type'] != "image/png" AND $HTTP_POST_FILES['FCKeditor_File']['type'] != "image/x-png" AND $HTTP_POST_FILES['FCKeditor_File']['type'] != "image/pjpeg" AND $HTTP_POST_FILES['FCKeditor_File']['type'] != "image/x-jpeg" AND $HTTP_POST_FILES['FCKeditor_File']['type'] != "image/gif"){

echo sprintf($lang['admin']['filemanager']['not_valid_mime'],$HTTP_POST_FILES['FCKeditor_File']['name']);

unlink($HTTP_POST_FILES['FCKeditor_File']['tmp_name']);

} else {

if (is_uploaded_file($HTTP_POST_FILES['FCKeditor_File']['tmp_name'])) {

$savefile = $GLOBALS['rootDir']."/images/uploads/".$HTTP_POST_FILES['FCKeditor_File']['name'];

if (move_uploaded_file($HTTP_POST_FILES['FCKeditor_File']['tmp_name'], $savefile)) {

@chmod($savefile, 0644);

// if image is a JPG check thumbnail doesn't exist and if not make one

$imageFormat = strtoupper(ereg_replace(".*\.(.*)$","\\1",$HTTP_POST_FILES['FCKeditor_File']['name']));

if($imageFormat == "JPG" || $imageFormat == "JPEG" || $imageFormat == "PNG" || ($imageFormat == "GIF" && $config['gdGifSupport']==1)){

// check image is not too big

$size = getimagesize($savefile);

if(($size[0] > $config['gdmaxImgSize']) OR ($size[1] > $config['gdmaxImgSize'])){

@chmod($savefile, 0775);

$thumb=new thumbnail($savefile);

$thumb->size_auto($config['gdmaxImgSize']);

$thumb->jpeg_quality($config['gdquality']);

$thumb->save($savefile);

}

if(file_exists($GLOBALS['rootDir']."/images/uploads/thumbs/thumb_".$HTTP_POST_FILES['FCKeditor_File']['name'])){

@chmod($GLOBALS['rootDir']."/images/uploads/thumbs/thumb_".$HTTP_POST_FILES['FCKeditor_File']['name'], 0775);

unlink($GLOBALS['rootDir']."/images/uploads/thumbs/thumb_".$HTTP_POST_FILES['FCKeditor_File']['name']);

}

$thumb=new thumbnail($GLOBALS['rootDir']."/images/uploads/".$HTTP_POST_FILES['FCKeditor_File']['name']);

// see if we need to resize

if(($size[0] > $config['gdthumbSize']) OR ($size[1] > $config['gdthumbSize'])){

$thumb->size_auto($config['gdthumbSize']);

} else {

$thumb->size_auto($size[0]);

}

$thumb->jpeg_quality($config['gdquality']);

$thumb->save($GLOBALS['rootDir']."/images/uploads/thumbs/thumb_".$HTTP_POST_FILES['FCKeditor_File']['name']);

}

echo sprintf($lang['admin']['filemanager']['image_upload_success'],$HTTP_POST_FILES['FCKeditor_File']['name']);

if(!isset($_POST['redir'])){

?>

<script language=javascript>

<?php if($_POST["custom"]==1){ ?>

window.opener.addImage('<?php echo $HTTP_POST_FILES['FCKeditor_File']['name']; ?>', '<?php echo $GLOBALS['rootRel']."images/uploads/".$HTTP_POST_FILES['FCKeditor_File']['name']; ?>') ;

<?php } else { ?>

window.opener.setImage('<?php echo $GLOBALS['rootRel']."images/uploads/".$HTTP_POST_FILES['FCKeditor_File']['name']; ?>') ;

<?php } ?>

window.close();

</SCRIPT>

<?php

} // end if not set redir

}

}

} ?></span>

</TD>

</TR>

</TABLE>

</form>

<?php } ?>

<p align="center"><?php if(isset($_POST['submit'])){ ?><INPUT type="button" class="submit" value="<?php echo $lang['admin']['filemanager']['back']; ?>" onclick="history.back()"><?php } ?>

<INPUT type="button" class="submit" value="<?php echo $lang['admin']['filemanager']['close_window']; ?>" onclick="<?php if(isset($_POST['redir'])) { echo "window.opener.location.reload();"; } ?> java script:window.close();"></p>

</BODY>

</HTML>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...