close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Problems with upload images

Thread began 8/28/2009 9:26 am by webladesign285835 | Last modified 9/01/2009 3:07 pm by Jason Byrnes | 3534 views | 8 replies |

webladesign285835

Problems with upload images

Friends, I have a problem with Digital File Pro 2, but everything seems to work correctly when you finish the process of uploading the picture, then it is not displayed on the page. I mean there is a problem in which the image does not upload to the respective folder. Host has given the write permissions but still not up. Any solution? thanks. Sorry for my little english!

Sign in to reply to this post

Jason ByrnesWebAssist

To trouble shoot the image upload, first make sure the page does not redirect to another after the image uploadsd. Then add the following at line 1 to see if a PHP error is occurring:

php:
<?php

error_reporting
(E_ALL);
ini_set('display_errors','on);
?>




Then go to the bindings panel and expand the WA Uploaded Files Global Status group and drag the debug info binding to the page.

after testing uploading an image, post back with the debug info on the page and any PHP errors if they appear.

Sign in to reply to this post

webladesign285835

The problem persist! oops!

Friends, I did as requested and here I send the number of errors appearing on the page.
They also insert the code of the page to be looked at.
Urgent need to fix this! to be able to upload images to the respective folder.
Thanks

Errors in the page:

Notice: Use of undefined constant on - assumed 'on' in /home/comite/public_html/admin/prensa/prensa.php on line 3

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/comite/public_html/admin/prensa/prensa.php:3) in /home/comite/public_html/WA_SecurityAssist/Helper_PHP.php on line 5

Warning: Cannot modify header information - headers already sent by (output started at /home/comite/public_html/admin/prensa/prensa.php:3) in /home/comite/public_html/admin/prensa/prensa.php on line 62

Warning: move_uploaded_file(/home/comite/public_html/admin/prensa/../../images/prensa/lg/fb6a7b6c31a5f146491c3253e9ddc19e_tmp.png) [function.move-uploaded-file]: failed to open stream: Permission denied in /home/comite/public_html/WA_DigitalFilePro/HelperPHP.php on line 96

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpUajGtC' to '/home/comite/public_html/admin/prensa/../../images/prensa/lg/fb6a7b6c31a5f146491c3253e9ddc19e_tmp.png' in /home/comite/public_html/WA_DigitalFilePro/HelperPHP.php on line 96

Warning: copy(/home/comite/public_html/admin/prensa/../../images/prensa/lg/fb6a7b6c31a5f146491c3253e9ddc19e_tmp.png) [function.copy]: failed to open stream: No such file or directory in /home/comite/public_html/WA_DigitalFilePro/HelperPHP.php on line 98

Warning: copy(/home/comite/public_html/admin/prensa/../../images/prensa/lg/fb6a7b6c31a5f146491c3253e9ddc19e_tmp.png) [function.copy]: failed to open stream: No such file or directory in /home/comite/public_html/WA_DigitalFilePro/HelperPHP.php on line 98



Code of Page:


<?php
error_reporting(E_ALL);
ini_set('display_errors',on);
?>
<?php require_once('../../Connections/comite.php'); ?>
<?php require_once("../../WA_DigitalFilePro/HelperPHP.php"); ?>
<?php require_once( "../../WA_SecurityAssist/Helper_PHP.php" ); ?>
<?php
if (!WA_Auth_RulePasses("Logged in to administradores")){
WA_Auth_RestrictAccess("../../index.php");
}
?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}

$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO prensa (imagen_url) VALUES (%s)",
GetSQLValueString($_POST['imagen_url'], "text"));

mysql_select_db($database_comite, $comite);
$Result1 = mysql_query($insertSQL, $comite) or die(mysql_error());

$insertGoTo = "";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}

mysql_select_db($database_comite, $comite);
$query_prensa = "SELECT * FROM prensa";
$prensa = mysql_query($query_prensa, $comite) or die(mysql_error());
$row_prensa = mysql_fetch_assoc($prensa);
$totalRows_prensa = mysql_num_rows($prensa);?>
<?php
// WA_UploadResult1 Params Start
$WA_UploadResult1_Params = array();
// WA_UploadResult1_1 Start
$WA_UploadResult1_Params["WA_UploadResult1_1"] = array(
'UploadFolder' => "../../images/prensa/lg/",
'FileName' => "[FileName]",
'DefaultFileName' => "",
'ResizeType' => "0",
'ResizeWidth' => "120",
'ResizeHeight' => "120",
'ResizeFillColor' => "#FFFFFF" );
// WA_UploadResult1_1 End
// WA_UploadResult1_2 Start
$WA_UploadResult1_Params["WA_UploadResult1_2"] = array(
'UploadFolder' => "../../images/prensa/tn/",
'FileName' => "[FileName]",
'DefaultFileName' => "",
'ResizeType' => "4",
'ResizeWidth' => "85",
'ResizeHeight' => "140",
'ResizeFillColor' => "#FFFFFF" );
// WA_UploadResult1_2 End
// WA_UploadResult1 Params End
?>
<?php
WA_DFP_SetupUploadStatusStruct("WA_UploadResult1");
if($_SERVER["REQUEST_METHOD"] == "POST"){
WA_DFP_UploadFiles("WA_UploadResult1", "subirprensa", "0", "", "JPG:80", $WA_UploadResult1_Params);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script src="../../WA_DigitalFilePro/jquery-blockui-formprocessing.js" type="text/javascript"></script>...
...<!--
@import url("../../css/dashboard_style.css");
-->
</style>
<style type="text/css" media="print">

body {
background-color: #fff;
background-image: none;
border-color: #000; /* Sets the border color properties for an element using shorthand notation */
color: #000;
}
-->
</style>
<!--[if IE 5]>
<style type="text/css">
#outerWrapper #contentWrapper #leftColumn1 {
width: 220px;
}
</style>
<![endif]-->
<!--[if IE]>
<style type="text/css">

#outerWrapper #contentWrapper, #outerWrapper #contentWrapper #content {
zoom: 1;
}
</style>
<![endif]-->
<!--[if lt IE 7]>
<style type="text/css">
img, div {
behavior: url("../dashboardcomitemexicano_images/iepngfix.htc");
}
</style>
<![endif]-->
<!-- TemplateBeginEditable name="head" -->
<!-- TemplateEndEditable -->
<style type="text/css">


.arrowgreen{
width: 180px; /*width of menu*/
border-style: solid solid none solid;
border-color: #94AA74;
border-size: 1px;
border-width: 1px;
}

.arrowgreen ul{
list-style-type: none;
margin: 0;
padding: 0;
}

.arrowgreen li a{
font: bold 12px Verdana, Arial, Helvetica, sans-serif;
display: block;
background: transparent url(../images/arrowgreen.gif) 100% 0;
height: 24px; /*Set to height of bg image- padding within link (ie: 32px - 4px - 4px)*/
padding: 4px 0 4px 10px;
line-height: 24px; /*Set line-height of bg image- padding within link (ie: 32px - 4px - 4px)*/
text-decoration: none;
}

.arrowgreen li a:link, .arrowgreen li a:visited {
color: #5E7830;
}

.arrowgreen li a:hover{
color: #26370A;
background-position: 100% -32px;
}


.arrowgreen li a.selected{
color: #26370A;
background-position: 100% -64px;
}

</style>

</head>

<body>

<div id="outerWrapper">
<div id="header"></div>
<div id="topNavigation"><span style="font-weight: bold"></span</div>
<div id="contentWrapper">
<div id="leftColumn1">
<h2><div class="arrowgreen">
<ul>
<li><a href="../index.php" title="Home">Inicio Admin</a></li>
<li><a href="../homepage/home.php" class="selected" title="Inicio">Cambios en Inicio</a></li>
<li><a href="../fiestas/fiestas.php" title="Whois">Simbolos y Fiestas</a></li>
<li><a href="../comite/comite.php" title="Comite Mexicano">Comite Mexicano</a></li>
<li><a href="../historia/historia.php" title="Tools">Historia</a></li>
<li><a href="../prensa/prensa.php" title="JavaScript">Prensa</a></li>
</ul>
</div>
</a></p>
</div>
<div id="content"> <h1>Ingresar una imagen en la sección Prensa.</h1>
<hr />
<p style="font-size: 12px; color: #333; text-align: center;"><?php echo WA_DFP_AllUploadsDebug(); ?></p>
<div id="form1_ProgressWrapper">
<form action="<?php echo $editFormAction; ?>" method="post" enctype="multipart/form-data" id="form1">
<table>
<tr valign="baseline">
<td width="122" height="58" align="right">Nombre Imagen:</td>
<td width="468"><input type="text" name="imagen_url" value="" size="32" />
<span style="font-size: 12px"> </span></td>
</tr>
<tr valign="baseline">
<td height="47" align="right">Subir Imagen:</td>
<td width="468"><label>
<input type="file" name="subirprensa" id="subirprensa" />
</label></td>
</tr>
<tr valign="baseline">
<td height="35" align="right">&nbsp;</td>
<td><input type="submit" value="Insertar Imagen" /></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form1" />
</form>
</div>...
...<div id="form1_ProgressMessageWrapper" class="blockUIOverlay" style="display:none;">
<script type="text/javascript">
WADFP_SetProgressToForm('form1', 'form1_ProgressMessageWrapper', WADFP_Theme_Options['BigSpin:CaboSunset']);
</script>
<div id="form1_ProgressMessage" >
<p style="margin:10px; padding:5px;" ><img src="../../WA_DigitalFilePro/images/cabo-largespin.gif" alt="" title="" style="vertical-align:middle;" />&nbsp;&nbsp;Please wait</p>
</div>
</div>...

</body>
</html>
<?php
mysql_free_result($prensa);
?>

Sign in to reply to this post

tom92909Beta Tester

Hi,

Since it's Saturday morning, and I hate to see someone have trouble, I'm going to try and provide a little non WebAssist support assistance.

php:
<?php require_once('../../Connections/comite.php'); ?>
<?php 
require_once("../../WA_DigitalFilePro/HelperPHP.php"); ?>
<?php 
require_once( "../../WA_SecurityAssist/Helper_PHP.php" ); ?>
<?php
if (!WA_Auth_RulePasses("Logged in to administradores")){
WA_Auth_RestrictAccess("../../index.php");
}
?>



The above lines in your code reflect that you are requiring files that have paths that are kinda far away from all the action. Are you sure you have your paths to these files correct?


I believe that the error codes below that you're getting refer to not being able to talk to the WA_DigitalFilePro directory.

Warning: move_uploaded_file(/home/comite/public_html/admin/prensa/../../images/prensa/lg/fb6a7b6c31a5f146491c3253e9ddc19e_tmp.png) [function.move-uploaded-file]: failed to open stream: Permission denied in /home/comite/public_html/WA_DigitalFilePro/HelperPHP.php on line 96

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpUajGtC' to '/home/comite/public_html/admin/prensa/../../images/prensa/lg/fb6a7b6c31a5f146491c3253e9ddc19e_tmp.png' in /home/comite/public_html/WA_DigitalFilePro/HelperPHP.php on line 96

Warning: copy(/home/comite/public_html/admin/prensa/../../images/prensa/lg/fb6a7b6c31a5f146491c3253e9ddc19e_tmp.png) [function.copy]: failed to open stream: No such file or directory in /home/comite/public_html/WA_DigitalFilePro/HelperPHP.php on line 98

Warning: copy(/home/comite/public_html/admin/prensa/../../images/prensa/lg/fb6a7b6c31a5f146491c3253e9ddc19e_tmp.png) [function.copy]: failed to open stream: No such file or directory in /home/comite/public_html/WA_DigitalFilePro/HelperPHP.php on line 98


I hope that I'm on the right track, I'd hate to be leading on a fruitless waste of time.

:)

Sign in to reply to this post

webladesign285835

The problem persist! uffff!!!

The connection between the files is correct. Still the problem persists and now I've tasted in local mode I realize that the problem is in the code because it does not let me upload pictures to my computer. I'd love to know what's wrong and fix it urgently.
Just thanks for your help Tom! you are a friend!
:)

Sign in to reply to this post

tom92909Beta Tester

Sorry for the delay...

Below is a functional example. I hope it helps.

php:
<?php require_once("WA_DigitalFilePro/HelperPHP.php"); ?>

<?php 
require_once('Connections/dbconn.php'); ?>
<?php
// WA_UploadResult1 Params Start
$WA_UploadResult1_Params = array();
// WA_UploadResult1_1 Start
$WA_UploadResult1_Params["WA_UploadResult1_1"] = array(
    
'UploadFolder' => "images/",
    
'FileName' => "[FileName]",
    
'DefaultFileName' => "",
    
'ResizeType' => "0",
    
'ResizeWidth' => "0",
    
'ResizeHeight' => "0",
    
'ResizeFillColor' => "" );
// WA_UploadResult1_1 End
// WA_UploadResult1 Params End
?>
<?php
WA_DFP_SetupUploadStatusStruct
("WA_UploadResult1");
if(isset(
$_POST["Submit"])){
    
WA_DFP_UploadFiles("WA_UploadResult1""images""0""""true"$WA_UploadResult1_Params);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Upload Images</title>
<script  src="WA_DigitalFilePro/jquery-blockui-formprocessing.js" type="text/javascript"></script>
</head>
<body>
<form  action="" method="post" enctype="multipart/form-data" name="images" id="images1">
  <h2>Image Filename to Upload: <input type="file" name="images" id="images"></h2>
      <input name="Submit" type="submit" id="Submit" value="Submit">
      <input name="Reset" type="reset" id="Reset" value="Reset">
</form>
<?php
if(isset($_POST["Submit"])){
?>
Filename: <?php echo $WA_DFP_UploadStatus["WA_UploadResult1"]["clientFileName"]; ?> <font color="#FF0000"><strong><?php echo $WA_DFP_UploadStatus["WA_UploadResult1"]["errorMessage"]; ?></strong></font><br>
Width: <?php echo $WA_DFP_UploadStatus["WA_UploadResult1"]["imageWidth"]; ?><br>
Height: <?php echo $WA_DFP_UploadStatus["WA_UploadResult1"]["imageHeight"]; ?><br>
<?php
} else {
}
?>
</body>
</html>
Sign in to reply to this post

Jason ByrnesWebAssist

The error message you are getting:
Warning: move_uploaded_file(/home/comite/public_html/admin/prensa/../../images/prensa/lg/fb6a7b6c31a5f146491c3253e9ddc19e_tmp.png) [function.move-uploaded-file]: failed to open stream: Permission denied


means that you do not have Write Permissions on the images/prensa/lg/ directory on the server.

check with your ghost to determine what tools they have available for managing directory permissions and make sure to give write access for all users to the folders you wish to upload images to.

Sign in to reply to this post

webladesign285835

The problem persists even in local mode.

I've checked permissions and they are correct, so why not because the files do not rise to the respective folder, I have reviewed the routes and are also correct. Anyway there must be some problem in scripts because in local mode (localhost) and likewise do not rise files to the respective folder. What can I do?

Sign in to reply to this post

Jason ByrnesWebAssist

The error message says that the permission level is not correct, double check that the permissions level on the upload folder is set to 766 this will allow read write execute to the owner, read write to the group and read write to everyone.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...