Setting Image Path
Hi,
Merry Easter to All of You!..
i am facing a problem in setting the dynamic image path in crystal report
the path is stored in Database field,and physical images are stored in a folder
the path specified is relative path and works fine when the report is run directly , but it seems that the report runs in temp folder when called from vb.net windows application.
hence the relative path specified w.r.t to database field fails when called from application.
Download SP 0 for CR 2008 from here:
https://smpdl.sap-ag.de/~sapidp/012002523100007528552008E/cr2008_sp0.zip
Next, see [this|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_erq/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes.do] note on how to work with image in Crystal Reports.
Ludek
Similar Messages
-
Hello all,
I've created a XFA Dynamic form that imports a number of records from one of our local databases. One of these fields is the path to an image. I would like to set an image field to that url... or, better still, embed the image into the .pdf form itself.
Everything that I've read has told me that the only way to do so is to set the image field's raw value to a base64 string representation of that image. This isn't an option, as I have no way to convert that image to base64.... unless I can do so via SQL or javascript. I've been trying to do this for a few days with no luck.
I figure that I'm not the only one who has had this porblem. I was hoping that someone out there has developed a solution that they would be willing to share. I'd appreciate any help that anyone might be able to offer. Thanks =)
- ScottHi there,
Thanks for your reply. The URL field is useful only to set a default image path. under the binding tab, when I bind the image to the url from a data connection, the url is displayed as text within the image field. No image appears.
The only solution that I've found online is to somehow get the image converted to base64... the issue is that the only technologies that I have available to me are SQL or javascript... neither of which were designed to convert images to base64.
Does onyone know where I can find a javascript function to convert an image to base64?
- Scott -
Set image path in java class library
Hi,
I created a java class library project and made .jar file. My java class library contains .jpg files in separete folder named as Images. My .jar file contains list of classes and image folder also but when i am using .jar file in applet. java class library is working but images are not shown. Let me know how to create imageicon to show images also in the class libraryImageIcon icon = new ImageIcon(getClass().getResource(path-to-file));
-
How to set image source path in formsweb.cfg file in forms 11g
Hi,
I had written HTML code in the formsweb.cfg file in forms 11g. In the below code i am unable to retrive image file(i.e., .gif, .jpeg) from the server or local machine.
In the below HTML code i set image source in the image tag as below:
<img src="E:\Oracle\Middleware\Oracle_FRHome1\tools\web\html\agilis-life-new11_04.GIF"
Is this correct path to fetch the images from the server or local machine .
Please help me out how to set path for image in html or is there any alternate process to retrive images.
Here is the code :
[INDIVIDUALUAT]
workingDirectory=D:\Aims10dev\Work
form=LMstartup.fmx
userid=rmenu/rmenu@RLIFEQA64
codebase=/forms/java
imageBase=codebase
width=1005
height=750
WebUtilArchive=/forms/java/frmwebutil.jar,/forms/webutil/jacob.jar
WebUtilLogging=off
WebUtilLoggingDetail=normal
WebUtilErrorMode=Alert
WebUtilDispatchMonitorInterval=5
WebUtilTrustInternal=true
WebUtilMaxTransferSize=16384
baseHTMLjinitiator=webutiljini.htm
baseHTMLjpi=webutiljpi.htm
archive_jini=frmall_jinit.jar,life-icons-round.jar,Agilis_Icon.jar,life_Icon.jar,personalize.jar,hyperlink.jar,amazingbutton.jar
archive=frmall.jar
separateFrame=False
lookandfeel=Generic
EndUserMonitoringURL=True
usesdi=yes
#HTMLbeforeForm= <table width="1005" border="0" cellspacing="0" cellpadding="0"><tr><td width="200"><img src="/forms/html/agilis-life-logo.gif" width="200" height="80" /></td><td width="10"><img src="/forms/html/agilis-life-new11_02.gif" width="36" height="80" /></td><td width="805" valign="top" background="/forms/html/agilis-life-new11_03.gif"></td></tr></td></tr></table>
HTMLbeforeForm=<body topmargin="0" leftmargin="0" > <table width="1005" height="100" border="0" cellspacing="0" cellpadding="0"><tr><td width="200" valign="bottom" ><img src="E:\Oracle\Middleware\Oracle_FRHome1\tools\web\html\agilis-life-logo.gif" width="200" height="80" /></td><td width="10" valign="bottom" ><img src="E:\Oracle\Middleware\Oracle_FRHome1\tools\web\html\agilis-life-new11_02.gif" width="36" height="80" /></td><td width="550" valign="bottom" ><img src="E:\Oracle\Middleware\Oracle_FRHome1\tools\web\html\agilis-life-new11_03.gif" width="550" height="80" /></td><td valign="bottom"><table width="219" height="90" border="0" cellspacing="0" cellpadding="0"><tr><td height="36" valign="bottom" align="center"><img src="E:\Oracle\Middleware\Oracle_FRHome1\tools\web\html\agile-logo.jpg" height="36"></td></tr><tr><td height="10" valign="bottom"> <div align="right"><span style="font-family:Arial, Helvetica, sans-serif; font-size:12px; font-weight:bold; text-decoration:none; color:#00000; " >Home | Change Password | Logout</span></div></td></tr><tr><td colspan="3" valign="bottom"><img src="E:\Oracle\Middleware\Oracle_FRHome1\tools\web\html\agilis-life-new11_04.GIF" width="100%" height="39" /></td></tr></table></td></tr></td></tr></table></body>AFAIK, this is not the correct way to set the image location.
We call the working directory as context, so inside the context root along with WEB-INF, maintain a folder with name img and put all the images in that directory.
You can use either .\<image_folder> or the optimum way would be (if you are using JSPs) to use getContext() method and traverse accordingly.
FYI,,, using getContext() will give you context root directory, from there it is as simple as accessing any other folder.
Hope this answers your question.
Cheers,
Jeets. -
Image path sets ( servername) instead of \\servername
Due to a hardware meltdown I have had to rip the NW server out of the tree
and install a new one.
I have re-installed the server NW65sp8 and reinstalled ZENworks for Desktops
7
Now, When I set an imaging job on a workstation I browse to the server etc
and set the file path.
When I click apply or ok leave the object and go back in the path has
changed;
eg
(ZFDSRVSR) USER\zenimg\ws_master.zmg
instead of
\\ZFDSRVSR\USER\zenimg\ws_master.zmg
Any ideas on how I fix this?
Manual imaging works ok. I have deleted the ws object and re imported into
eDir
TomI have resolved this.
>>> On 21/07/2010 at 12:54 p.m., in message
<[email protected]>,
Tom Cummings<[email protected]> wrote:
> This is turning out to be serious ant not server related. I installed a
> new
> ZFD7 server into a new container. Setting an image path on using that
> server reproduces the same problem.
>
> Help! :‑(
>
>
>
>>>> On 20/07/2010 at 9:07 AM, in message
> <[email protected]>,
> Tom Cummings<[email protected]> wrote:
>> Due to a hardware meltdown I have had to rip the NW server out of the
>> tree
>> and install a new one.
>>
>> I have re‑installed the server NW65sp8 and reinstalled ZENworks for
>> Desktops
>> 7
>>
>> Now, When I set an imaging job on a workstation I browse to the server
>> etc
>> and set the file path.
>>
>> When I click apply or ok leave the object and go back in the path has
>> changed;
>>
>> eg
>>
>> (ZFDSRVSR) USER\zenimg\ws_master.zmg
>>
>> instead of
>>
>> \\ZFDSRVSR\USER\zenimg\ws_master.zmg
>>
>> Any ideas on how I fix this?
>>
>> Manual imaging works ok. I have deleted the ws object and re imported
>> into
>> eDir
>>
>> Tom -
Screen Painter Image Button cannot set relative path
Hi,
I am using screen painter to create a UI form and i put image into each button. The form can run properly in my PC due to the image path is under my local path. However, the button is gone when i install the UI form in other PC. When using button object in screen painter and it not allow me to set the relative path. Anyone can help??
Cheers,
AnnaHi Gianluigi,
Thanks for your reply. However, i did try to rename the .srf file to .xml file and change the path to the following
<b><specific image=".\test3.jpg" /></b>
But the program didn't work. But if i change it to <b><specific image="c:\test3.jpg" /></b>, give it the exact path then the program work again.
Do you have any idea on it?
Anna -
How to i add an image path with spry data set
hi
how to i add an image path with spry data set. I made a xml file and then created a data set in html but image won't load
this is my XML
<?xml version="1.0" encoding="UTF-8"?>
<banner width = "185" height = "400">
<item>
<image scr = "nui-panforte-recipe_01.jpg" ></image>
<description>CHOC-COCONUT PANFORTE</description>
<text1>Try this delicious GLUTEN FREE Christmas treat</text1>
<text2>CHOC-COCONUT PANFORTE</text2>
</item>
</banner>
this is my HTML
<!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" xmlns:spry="http://ns.adobe.com/spry">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script src="../../SpryAssets/xpath.js" type="text/javascript"></script>
<script src="../../SpryAssets/SpryData.js" type="text/javascript"></script>
<script type="text/javascript">
<!--
var ds1 = new Spry.Data.XMLDataSet("recipe_banner.xml", "banner/item");
//-->
</script>
</head>
<body>
<div spry:region="ds1">
<table>
<tr spry:repeat="ds1">
<td>{image}</td>
<td>{description}</td>
<td>{text1}</td>
<td>{text2}</td>
<td>{text3}</td>
<td>{text4}</td>
<td>{link}</td>
<td>{url}</td>
<td>{target}</td>
</tr>
</table>
</div>
</body>
</html>It would be helpfull if you actually created an <img> tag to start with
<img src="{image/@src}" />
would work. -
Programatically set ole object image path
Hi to all,
I'm using Visual Studio 2005, Asp.net 2.0-C# and CR 11 Sp2.
In my rpt file i added one ole object as bitmap i want to pass the data(image path) to this bitmap by programtically how to do this? Experts please help meHello, Winseelan;
If you are using Crystal Reports XI R2 (11.5) SP2 or later you can do this programatically using the 'Graphic Location' conditional formula.
To do this, perform the following steps:
1. Open the report in the Crystal Reports Designer.
2. Create a formula called "Location" that contains a temporary path string to an image file. For example, "C:\Images\Image1.jpg".
3. Right-click the image on the report and click 'Format Graphic'. The 'Format Editor' dialog box appears.
4. In the 'Picture' tab, click the 'Graphic Location' conditional formula button. The Format Formula Editor appears.
5. Call the "Location" formula from this conditional formula.
6. Save changes to the report.
7. In your application, you can now change the location of the image file at run time, by modifying the text in the "Location" formula programmatically using the following code:
myReport.DataDefinition.FormulaFields.Item("Location").Text = "C:\Images\Image2.jpg"
You can now view the image successfully when previewing your report in the application.
Elaine -
LinkListExplorer iview BackGround Image path not working
HI All ,
As i am using Layout set LinkListExplorer for few external links , when i am giving image name for eg growth.jpg in background image path, which is placed at /etc/public/mimes/images it is not showing anything , the same is working for NewsBrowser Layout set . I have tried many thing all possiblities but no success .
Pls help me in this regard.
Shwetang saxenaHi Vedant,
APEX only replaces the #WORKSPACE_IMAGES# variable within APEX itself. This is quite logical, because what you see in the APEX developer space is generated by PL/SQL from the database, so APEX can change what it wants. APEX can't access the files however, that's logical to because APEX would need premissions on the server and an Oracle directoryto start doing changes to files.
So if you want to point to the image directory in the CSS file you need to provide the full path.
Regards,
Joni -
Hi all,
I'm trying to deliver a BI report using the ftp device.
The report is delivered in HTML format correctly, but
when I try to open it, images that should display charts
are not visible.
Giving a look at the HTML code I've noticed that the image
source path is:
<img src="/xmlpserver/xdo/tmp/xdoimgZA4ql3v7Hz31567.gif">
which is not the correct path.
Is there a way to automatically set that path when the
report is delivered?
Thank you in advance,
RobertoIf you were to output the same report as PDF instead of HTML, I'm guessing the PDF file would contain the actual image. (Am I right anyone?) However, when you output as HTML, there is no way to embed an image in the HTML output.
HTML can only reference external images via URLs, so it appears from your output HTML code that BI Publisher creates a temporary GIF image and allows it to be referenced via that unique URL. Who knows how long that URL is valid?
After you FTP the output to another server, the <img src> reference is no longer valid, because the path in the src attribute is relative to the HTML file itself. The FTP'd report might show the image if you edit the HTML file so the src attribute includes the full URL to the image:
<img src="http://bi.publisher.host:port/xmlpserver/xdo/tmp/xdoimgZA4ql3v7Hz31567.gif"/>
But again, how long does BI Publisher cache the image, and how long until the login session times out so you can no longer access it anyway? Note that you would have to use the same browser session to view the FTP'd report as was used to run the report in the first place. In other words, run the BIP report initially using a browser on the host that is the FTP destination for the report. Then edit the <img> tag, and finally open the HTML file in the same browser.
A note to other readers: Images in RTF templates are often used as mere placeholders for charts created when the report is run. It is the "Alternate Text" assigned to the dummy image that tells the XSL-FO processor how to replace the image with a chart displaying the report output data.
To solve this problem in a more supportable way, please see this Tim Dexter blog entry:
http://blogs.oracle.com/xmlpublisher/2006/10/31/
Edited by: Multiverse on Aug 15, 2009 7:59 PM (added Tim Dexter blog reference) -
Storing Uploaded Image Path into Mysql
Hi I am developing a cms and am using the code David gives in his book PHP Solutions, everything works fine but I can't work out how to extract the uploaded path so that it is stored in my table.
Help would be really appreciated, I am making good progress in learning the php especially with David's books but am still struggling when it comes to having to customized the code.
The code for the upload.php is as follows,
<?php
class Gp1_Upload{
protected $_uploaded = array();
protected $_destination;
protected $_max = 51200;
protected $_messages = array();
protected $_permitted = array('image/gif',
'image/jpeg',
'image/pjpeg',
'image/png');
protected $_renamed = false;
public function __construct($path) {
if (!is_dir($path) || !is_writable($path)) {
throw new Exception("$path must be a valid, writable directory.");
$this->_destination = $path;
$this->_uploaded = $_FILES;
public function getuploadpath (){
public function getMaxSize() {
return number_format($this->_max/1024, 1) . 'kB';
public function setMaxSize($num) {
if (!is_numeric($num)) {
throw new Exception("Maximum size must be a number.");
$this->_max = (int) $num;
public function move($overwrite = false) {
$field = current($this->_uploaded);
if (is_array($field['name'])) {
foreach ($field['name'] as $number => $filename) {
// process multiple upload
$this->_renamed = false;
$this->processFile($filename, $field['error'][$number], $field['size'][$number], $field['type'][$number], $field['tmp_name'][$number], $overwrite);
} else {
$this->processFile($field['name'], $field['error'], $field['size'], $field['type'], $field['tmp_name'], $overwrite);
public function getMessages() {
return $this->_messages;
protected function checkError($filename, $error) {
switch ($error) {
case 0:
return true;
case 1:
case 2:
$this->_messages[] = "$filename exceeds maximum size: " . $this->getMaxSize();
return true;
case 3:
$this->_messages[] = "Error uploading $filename. Please try again.";
return false;
case 4:
$this->_messages[] = 'No file selected.';
return false;
default:
$this->_messages[] = "System error uploading $filename. Contact webmaster.";
return false;
protected function checkSize($filename, $size) {
if ($size == 0) {
return false;
} elseif ($size > $this->_max) {
$this->_messages[] = "$filename exceeds maximum size: " . $this->getMaxSize();
return false;
} else {
return true;
protected function checkType($filename, $type) {
if (empty($type)) {
return false;
} elseif (!in_array($type, $this->_permitted)) {
$this->_messages[] = "$filename is not a permitted type of file.";
return false;
} else {
return true;
public function addPermittedTypes($types) {
$types = (array) $types;
$this->isValidMime($types);
$this->_permitted = array_merge($this->_permitted, $types);
protected function isValidMime($types) {
$alsoValid = array('image/tiff',
'application/pdf',
'text/plain',
'text/rtf');
$valid = array_merge($this->_permitted, $alsoValid);
foreach ($types as $type) {
if (!in_array($type, $valid)) {
throw new Exception("$type is not a permitted MIME type");
protected function checkName($name, $overwrite) {
$nospaces = str_replace(' ', '_', $name);
if ($nospaces != $name) {
$this->_renamed = true;
if (!$overwrite) {
$existing = scandir($this->_destination);
if (in_array($nospaces, $existing)) {
$dot = strrpos($nospaces, '.');
if ($dot) {
$base = substr($nospaces, 0, $dot);
$extension = substr($nospaces, $dot);
} else {
$base = $nospaces;
$extension = '';
$i = 1;
do {
$nospaces = $base . '_' . $i++ . $extension;
} while (in_array($nospaces, $existing));
$this->_renamed = true;
return $nospaces;
protected function processFile($filename, $error, $size, $type, $tmp_name, $overwrite) {
$OK = $this->checkError($filename, $error);
if ($OK) {
$sizeOK = $this->checkSize($filename, $size);
$typeOK = $this->checkType($filename, $type);
if ($sizeOK && $typeOK) {
$name = $this->checkName($filename, $overwrite);
$success = move_uploaded_file($tmp_name, $this->_destination . $name);
if ($success) {
$message = "$filename uploaded successfully";
if ($this->_renamed) {
$message .= " and renamed $name";
$this->_messages[] = $message;
} else {
$this->_messages[] = "Could not upload $filename";
?>
The code for my form page is this
<!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>Untitled Document</title>
</head>
<body>
<?php
//THE FOLLOWING CODE IS FOR THE UPLOADING OF IMAGES AND FILES
// set the max upload size in bytes
$max = 51200;
if (isset ($_POST ['submit']))
//define the path to the upload folder
$destination = 'uploads/';
require_once('classes/Upload.php');
try {
$upload = new Gp1_Upload($destination);
$upload->setMaxSize($max);
$upload->move();
$result = $upload->getMessages();
} catch (Exception $e) {
echo $e->getMessage();
// END OF UPLOADING OF IMAGES AND FILES
?>
<form id="newvenue" action="" method="post" enctype="multipart/form-data" >
<?php
// THIS CODE DISPLAYS ERROR MESSAGES FOR THE FILE UPLOADS
if (isset($result)){
echo '<ul>';
foreach ($result as $message){
echo "<li>$message</li>";
echo '</ul>';
?>
<table id="neweventdisplay" cellpadding="5" border="0">
<tr>
<td></td>
<td><input type="hidden" name="user_id" value="" /></td>
</tr>
<tr>
<td></td>
<td>Organisers Name</td>
<td><input class="input80px" id="org_name" name="org_name" type="text" /> </td>
</tr>
<tr>
<td></td>
<td><label for="image">Upload image:</label></td>
<td><p>
<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $max; ?>" />
<input type="file" name="image" id="image" />
</p></td>
</tr>
<tr>
<td></td>
<td>Details about your upload</td>
<td><input class="input80px" id="org_uploadcapt" name="org_uploadcapt" type="text" /></td>
</tr>
<tr>
<td></td>
<td><input type="submit" name="submit" id="submit" value="upload"></td>
</tr>
<tr>
<td class="heading"> </td>
<td></td>
</tr>
</table>
</form>
<prep>
<?php
if (isset ($_POST ['submit'])){
print_r($_FILES);}
?>
</prep>
</body>
</html>Hi David
Thank you very much for your help. I had continued to work on the code and had worked out how to input the image path into the database but it was using the original filename, so when every it is changed it did not work. The code in my page at that point was the following,
<?php // 2. NEW USER REGISTRATION<br />
include_once ("includes/form_functions.inc.php");
$max = 100000;
$destination = 'uploads/';
// START FORM PROCESSING FOR A NEW REGISTRATION
if (isset($_POST['submit'])) { // Form has been submitted.
$errors = array();
// perform validations on the form data
$required_fields = array('org_name');
$errors = array_merge($errors, check_required_fields($required_fields, $_POST));
$required_numberfields = array('user_id');
$errors = array_merge($errors, check_number_fields($required_numberfields, $_POST));
$fields_with_lengths = array('org_name' => 36, 'org_website' => 100, 'org_contact' => 40, 'org_conemail' => 80, 'org_contel' => 30);
$errors = array_merge($errors, check_max_field_lengths($fields_with_lengths, $_POST));
/*Here I am using trim as well as ucwords, this function converts the first letter of each work into a capital letter, I am using this only on the
firstname and surname to ensure that the data is how I want it as it is going into the database, The better the data is preformated the better the data
swill be within the database.*/
$org_name = trim(strtolower(mysql_prep($_POST['org_name'])));
$org_website = trim(strtolower(mysql_prep($_POST['org_website'])));
$org_contact = trim(strtolower (mysql_prep($_POST['org_contact'])));
$org_conemail = trim(strtolower (mysql_prep($_POST['org_conemail'])));
$org_contel = strtolower (mysql_prep($_POST['org_contel']));
$userid = $_POST['user_id'];
$org_uploadcapt = $_POST['org_uploadcapt'];
$image = $_FILES['image'];
/*Here is the code that takes the variable captured from the input form and matches it up with the appropriate field in the database. An important point with insertion is that the variables are in the same order as the mysql field names, there will be an error if the number of variables does not match the number of field names. Note that there is no entry for the user id as this is an auto increment file within mysql and so is not needed to be entered*/
if ( empty($errors) ) {
$sql = "INSERT INTO organiser
(org_name, org_website, org_contact, org_conemail, org_contel, user_id, org_uploadurl, org_uploadcapt)
VALUES
('{$org_name}', '{$org_website}', '{$org_contact}', '{$org_conemail}', '{$org_contel}', '{$userid}', '{$destination}".$image['name']."', '{$org_uploadcapt}' )";
$result = mysql_query($sql, $connection);
if ($result) {
$message = "The organiser was successfully created.<br />";
} else {
$message = "I am sorry but the organiser could not be added.";
$message .= "<br />" . mysql_error();
} else {
/* this counts the number of errors and informs the user of how many fields were
incorrectly entered*/
if (count($errors) == 1) {
$message = "There was 1 error in the form.";
} else {
$message = "There were " . count($errors) . " errors in the form.";
} else { // Form has not been submitted.
$org_name = "";
$org_website = "";
$org_contact = "";
$org_conemail = "";
$org_contel = "";
$userid = "";
$org_uploadcapt = "";
//THE FOLLOWING CODE IS FOR THE UPLOADING OF IMAGES AND FILES
// set the max upload size in bytes
if (isset ($_POST ['submit']))
//define the path to the upload folder
// Use This On The Local Hosting Machine
//$destination = 'C:/upload_test/';
// Use This On The Live Server
require_once('classes/Upload.php');
try {
$upload = new Gp1_Upload($destination);
$upload->setMaxSize($max);
$upload->move();
$result = $upload->getMessages();
} catch (Exception $e) {
echo $e->getMessage();
// END OF UPLOADING OF IMAGES AND FILES
?>
<title>Horse Events</title>
<?php include_once("includes/meta.inc.php");?>
<?php include_once("includes/cssfavgoogle.inc.php");?>
<link href="css/adminpanel.css" rel="stylesheet" type="text/css" />
<style>
input[type="number"] {
width:40px;
</style>
</head>
<body>
<div id="wrapper">
<div id="admincontent">
<form id="newvenue" action="neworganiser.php" method="post" enctype="multipart/form-data" >
<?php if (!empty ($message)) {echo "<p class=\"message\">" . $message . "</p>";} ?>
<?php if (!empty ($errors)) {display_errors($errors); } ?>
<?php
// THIS CODE DISPLAYS ERROR MESSAGES FOR THE FILE UPLOADS
if (isset($result)){
echo '<ul>';
foreach ($result as $message){
echo "<li>$message</li>";
echo '</ul>';
?>
<br />
<table id="neweventdisplay" cellpadding="5" border="0">
<tr>
<td></td>
<td><input type="hidden" name="user_id" value="<?php echo $url_userid ['user_id']; ?>" /></td>
</tr>
<tr>
<td> <span class="compuls">*</span></td>
<td>Organisers Name</td>
<td><input class="input80px" id="org_name" name="org_name" type="text" />
</td>
</tr>
<tr>
<td><span class="compuls">*</span></td>
<td>Their Website</td>
<td><input class="input80px" id="org_website" name="org_website" type="text" /></td>
</tr>
<tr>
<td><span class="compuls">*</span></td>
<td>Organisers Contact</td>
<td><input id="org_contact" name="org_contact" type="text" />eg: Mrs Jean Kelly</td>
</tr>
<tr>
<td><span class="compuls">*</span></td>
<td>Contact Email</td>
<td><input class="input80px" id="org_conemail" name="org_conemail" type="text" />
</td>
</tr>
<tr>
<td><span class="compuls">*</span></td>
<td>Contact Tel No.</td>
<td><input id="org_contel" name="org_contel" type="text" /></td>
</tr>
<tr>
<td></td>
<td><label for="image">Upload image:</label></td>
<td><p>
<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $max; ?>" />
<input type="file" name="image" id="image" />
</p></td>
</tr>
<tr>
<td></td>
<td>Details about your upload</td>
<td><input class="input80px" id="org_uploadcapt" name="org_uploadcapt" type="text" /></td>
</tr>
<tr>
<td></td>
<td><input type="submit" name="submit" id="submit" value="Add Your Organiser"></td>
</tr>
<tr>
<td class="heading"> </td>
<td></td>
</tr>
</table>
<a class="delete" href="controlpanel.php">Cancel</a>
</form>
</div>
I have added the code you kindly forwarded but am getting an error, I am still trying to learn the basics of php and am unsure of what to do next, my php Upload.php now looks like
<?php
class Gp1_Upload{
protected $_uploaded = array();
protected $_destination;
protected $_max = 100000;
protected $_messages = array();
protected $_permitted = array('image/gif',
'image/jpeg',
'image/pjpeg',
'image/png');
protected $_renamed = false;
protected $_filenames = array();
public function __construct($path) {
if (!is_dir($path) || !is_writable($path)) {
throw new Exception("$path must be a valid, writable directory.");
$this->_destination = $path;
$this->_uploaded = $_FILES;
public function getMaxSize() {
return number_format($this->_max/100000, 1) . 'kB';
public function setMaxSize($num) {
if (!is_numeric($num)) {
throw new Exception("Maximum size must be a number.");
$this->_max = (int) $num;
public function move($overwrite = false) {
$field = current($this->_uploaded);
if (is_array($field['name'])) {
foreach ($field['name'] as $number => $filename) {
// process multiple upload
$this->_renamed = false;
$this->processFile($filename, $field['error'][$number], $field['size'][$number], $field['type'][$number], $field['tmp_name'][$number], $overwrite);
} else {
$this->processFile($field['name'], $field['error'], $field['size'], $field['type'], $field['tmp_name'], $overwrite);
public function getMessages() {
return $this->_messages;
protected function checkError($filename, $error) {
switch ($error) {
case 0:
return true;
case 1:
case 2:
$this->_messages[] = "$filename exceeds maximum size: " . $this->getMaxSize();
return true;
case 3:
$this->_messages[] = "Error uploading $filename. Please try again.";
return false;
case 4:
$this->_messages[] = 'No file selected.';
return false;
default:
$this->_messages[] = "System error uploading $filename. Contact webmaster.";
return false;
protected function checkSize($filename, $size) {
if ($size == 0) {
return false;
} elseif ($size > $this->_max) {
$this->_messages[] = "$filename exceeds maximum size: " . $this->getMaxSize();
return false;
} else {
return true;
protected function checkType($filename, $type) {
if (empty($type)) {
return false;
} elseif (!in_array($type, $this->_permitted)) {
$this->_messages[] = "$filename is not a permitted type of file.";
return false;
} else {
return true;
public function addPermittedTypes($types) {
$types = (array) $types;
$this->isValidMime($types);
$this->_permitted = array_merge($this->_permitted, $types);
protected function isValidMime($types) {
$alsoValid = array('image/tiff',
'application/pdf',
'text/plain',
'text/rtf');
$valid = array_merge($this->_permitted, $alsoValid);
foreach ($types as $type) {
if (!in_array($type, $valid)) {
throw new Exception("$type is not a permitted MIME type");
protected function checkName($name, $overwrite) {
$nospaces = str_replace(' ', '_', $name);
if ($nospaces != $name) {
$this->_renamed = true;
if (!$overwrite) {
$existing = scandir($this->_destination);
if (in_array($nospaces, $existing)) {
$dot = strrpos($nospaces, '.');
if ($dot) {
$base = substr($nospaces, 0, $dot);
$extension = substr($nospaces, $dot);
} else {
$base = $nospaces;
$extension = '';
$i = 1;
do {
$nospaces = $base . '_' . $i++ . $extension;
} while (in_array($nospaces, $existing));
$this->_renamed = true;
return $nospaces;
protected function processFile($filename, $error, $size, $type, $tmp_name, $overwrite) {
$OK = $this->checkError($filename, $error);
if ($OK) {
$sizeOK = $this->checkSize($filename, $size);
$typeOK = $this->checkType($filename, $type);
if ($sizeOK && $typeOK) {
$name = $this->checkName($filename, $overwrite);
$success = move_uploaded_file($tmp_name, $this->_destination . $name);
if ($success) {
$message = "$filename uploaded successfully";
if ($this->_renamed) {
$message .= " and renamed $name";
$this->_messages[] = $message;
} else {
$this->_messages[] = "Could not upload $filename";
public getFilenames() {
return $this->_filenames;
?>
The error is Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE.
I have not worked with oop before and have only very briefly looked at the principle was on my foundation degree. -
Display image from image path (ASP)
Help needed please. Sorry if the topic has already been
discussed. I did a search but it returned nothing.
My problem.
I can display images on my website by choosing the datasource
and the image path from by database. No issues here. What I want is
to be able to open up a larger image by clicking on this image.
I created another page. On this page is an image placeholder.
The source again is the datasource with the image path to a larger
image. I used a behaviour to open this page however, it shows the
same image (the 1st record in my recordset) whichever image you
click on my origianl page.
Can someone please tell me how to do it? It would be
appreciated.I'm assuming that you are using a repeat region to display
the original
images.
You will need to pass the Primary Key to the new page, and
filter the
recordset on the new page based on that Primary Key.
For example, this would be the link to the new page:
<a
href="page2.asp?ID=<%=(rsImages.Fields.Item("ImageID").Value)%>"
Then on the new page filter the recordset SQL based on the
ImageID,
something like this:
<%
Dim rsImage__MMColParam
rsImage__MMColParam = "1"
If (Request.QueryString("ID") <> "") Then
rsImage__MMColParam = Request.QueryString("ID")
End If
%>
<%
Dim rsImage
Dim rsImage_cmd
Dim rsImage_numRows
Set rsImage_cmd = Server.CreateObject ("ADODB.Command")
rsImage_cmd.ActiveConnection = MM_connImage_STRING
rsImage_cmd.CommandText = "SELECT * FROM tblImages WHERE
ImageID = ?"
rsImage_cmd.Prepared = true
rsImage_cmd.Parameters.Append
rsImage_cmd.CreateParameter("param1", 5,
1, -1, rsImage__MMColParam) ' adDouble
Set rsImage = rsImage_cmd.Execute
rsImage_numRows = 0
%>
Ken Ford
Adobe Community Expert - Dreamweaver
Fordwebs, LLC
http://www.fordwebs.com
"leeweatherill" <[email protected]> wrote in
message
news:ft00gm$spm$[email protected]..
> Help needed please. Sorry if the topic has already been
discussed. I did a
> search but it returned nothing.
>
> My problem.
> I can display images on my website by choosing the
datasource and the
> image
> path from by database. No issues here. What I want is to
be able to open
> up a
> larger image by clicking on this image.
>
> I created another page. On this page is an image
placeholder. The source
> again
> is the datasource with the image path to a larger image.
I used a
> behaviour to
> open this page however, it shows the same image (the 1st
record in my
> recordset) whichever image you click on my origianl
page.
>
> Can someone please tell me how to do it? It would be
appreciated.
> -
Where i can set the path to retreive the Km files
Hello All,
How to access the KM content files in my portal Application. Where I can set the path to retrieve any file from KM. Please can any one help me.
Thanks in Advancehi
I am using the Following code. it gives error.i think i need to import some jar file. can you help which jar file to import and where i can find those jar files.
Thanks in Advance.
import com.sapportals.portal.prt.component.*;
import com.sapportals.portal.prt.resource.IResource;
import com.sapportals.portal.prt.resource.IResource.*;
import com.sapportals.portal.security.*;
import com.sapportals.portal.security.usermanagement.*;
public class test extends AbstractPortalComponent
public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
//IUser user = WPUMFactory.getUserFactory().getEP5User(request.getUser());
com.sapportals.portal.security.usermanagement.IUser user = null ;
IResource resourceContext = new ResourceContext(user);
RID rid = RID.getRID("http://epd.symbol.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.webdav/symbol_productinfo2/cs1504/images");
try {
IResource resource = ResourceFactory.getInstance()
.getResource(rid, resourceContext);
if( resource != null ) {
// resource found
System.out.println("resource " + resource.getRID() + " found");
} else {
// resource not found
System.out.println("resource " + resource.getRID() + " does not exist");
catch( Exception e ) {
// problem while retrieving the resource
System.out.println(
"exception while trying to get resource " + e.getRID()
+ ": " + e.getMessage() -
Create a trigger which set Image source with binding to a dependency property.
I'm trying to create a specified button which switch images every time it pressed, without using the Click CBFunction, so I'm using toggle button and triggers (checked unchecked) and I want this button to
supply DP of string so who ever uses is button will only have to specify the images paths and a click CBFuntion to
perform what ever he wishes.
I managed to create the mechanism for switching images with triggers(but the triggers image paths are hard coded and not using DP) and to enable setting a click CBFunction. When I switch the hard coded image path with a DP which return a string with
the path the program crush, an exception is thrown.
U.C xaml:
<UserControl x:Class="ButtonChangeImage.UserControl1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d">
<Grid>
<ToggleButton x:Name="btnCI">
<ToggleButton.Content >
<Image Name="img" Source="C:\Users\AmitL\Desktop\joecocker.jpg"/>
</ToggleButton.Content>
<ToggleButton.Triggers>
<EventTrigger RoutedEvent="ToggleButton.Checked">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.Target="{x:Reference img}" Storyboard.TargetProperty="Source">
<DiscreteObjectKeyFrame KeyTime="0:0:0">
<DiscreteObjectKeyFrame.Value>
<BitmapImage UriSource="{Binding FirstImage}"/>
<!--<BitmapImage UriSource="C:\Users\AmitL\Desktop\james-brown-010.jpg"/>--><!--if I switch to this line it works fine!-->
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
<EventTrigger RoutedEvent="ToggleButton.Unchecked">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.Target="{x:Reference img}" Storyboard.TargetProperty="Source">
<DiscreteObjectKeyFrame KeyTime="0:0:0">
<DiscreteObjectKeyFrame.Value>
<BitmapImage UriSource="C:\Users\AmitL\Desktop\joecocker.jpg"/>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
</ToggleButton.Triggers>
</ToggleButton>
</Grid>
</UserControl>
U.C cs:
public partial class UserControl1 : UserControl
public static readonly DependencyProperty FirstImageDP = DependencyProperty.Register("FirstImage", typeof(string), typeof(UserControl1), new PropertyMetadata(@"C:\Users\AmitL\Desktop\james-brown-010.jpg", new PropertyChangedCallback(FirstImageSource)));
private string m_strFirstImage = string.Empty;
private BitmapImage m_oBMImage = null;
private static void FirstImageSource(DependencyObject obj, DependencyPropertyChangedEventArgs args)
UserControl1 l_UCBtnSwitchImage = (UserControl1)obj;
l_UCBtnSwitchImage.m_strFirstImage = (string)args.NewValue;
l_UCBtnSwitchImage.m_oBMImage = new BitmapImage(new Uri(l_UCBtnSwitchImage.m_strFirstImage, UriKind.Absolute));
public string FirstImage
get
string l_strTemp = (string)GetValue(FirstImageDP);
return l_strTemp;
set
SetValue(FirstImageDP, value);
public event RoutedEventHandler Click
add { btnCI.Click += value; }
remove { btnCI.Click -= value; }
public UserControl1()
InitializeComponent();
window xaml:
<Window x:Class="ButtonChangeImage.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:m="clr-namespace:ButtonChangeImage"
Title="MainWindow" Height="350" Width="525">
<Grid>
<m:UserControl1 Click="ToggleButton_Checked" FirstImage="C:\Users\AmitL\Desktop\james-brown-010.jpg"></m:UserControl1>
</Grid>
</Window>
The exception:
A first chance exception of type 'System.Windows.Markup.XamlParseException' occurred in PresentationFramework.dll
Additional information: 'Provide value on 'System.Windows.StaticResourceExtension' threw an exception.' Line number '20' and line position '46'.
I would love to know why when I switch the hard coded value with DP it suddenly throw exception, how to fix it or if there is other way to achieve U.C with those demands.
Thanks.Hey Magnus,
Unfortunately I get the same result, the button is switching between the (Joe Cocker) image to blue button(normal pressed button look) how come the
(Joe Cocker) image return I didn't set a trigger for unchecked so what make it change the content
or the image source back to that image?
And I can't debug (by the way what's happening there how come it doesn't stop in all those code lines?).
I didn't make any changes here is all the code:
U.C cs:
namespace ButtonChangeImage
public class ImageConverter : IValueConverter
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
string s = value as string;
var source = new System.Windows.Media.Imaging.BitmapImage();
source.BeginInit();
source.UriSource = new Uri(s, UriKind.RelativeOrAbsolute);
source.EndInit();
return source;
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
throw new NotImplementedException();
public partial class UserControl1 : UserControl
public static readonly DependencyProperty FirstImageDP = DependencyProperty.Register("FirstImage", typeof(string), typeof(UserControl1), new PropertyMetadata(@"C:\Users\AmitL\Desktop\james-brown-010.jpg", new PropertyChangedCallback(FirstImageSource)));
private string m_strFirstImage = string.Empty;
private BitmapImage m_oBMImage = null;
private static void FirstImageSource(DependencyObject obj, DependencyPropertyChangedEventArgs args)
UserControl1 l_UCBtnSwitchImage = (UserControl1)obj;
l_UCBtnSwitchImage.m_strFirstImage = (string)args.NewValue;
l_UCBtnSwitchImage.m_oBMImage = new BitmapImage(new Uri(l_UCBtnSwitchImage.m_strFirstImage, UriKind.Absolute));
public string FirstImage
get
string l_strTemp = (string)GetValue(FirstImageDP);
return l_strTemp;
set
SetValue(FirstImageDP, value);
public event RoutedEventHandler Click
add { btnCI.Click += value; }
remove { btnCI.Click -= value; }
public UserControl1()
InitializeComponent();
U.C xaml:
<UserControl x:Class="ButtonChangeImage.UserControl1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d">
<Grid>
<ToggleButton x:Name="btnCI" xmlns:local="clr-namespace:ButtonChangeImage">
<ToggleButton.Resources>
<local:ImageConverter x:Key="conv" />
</ToggleButton.Resources>
<ToggleButton.Style>
<Style TargetType="ToggleButton">
<Setter Property="Content">
<Setter.Value>
<Image Name="img" Source="C:\Users\AmitL\Desktop\joecocker.jpg"/>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter Property="Content">
<Setter.Value>
<Image Source="{Binding Path=FirstImage, Converter={StaticResource conv}}"/>
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
</ToggleButton.Style>
</ToggleButton>
</Grid>
</UserControl>
Main Window cs:
namespace ButtonChangeImage
public partial class MainWindow : Window
public MainWindow()
InitializeComponent();
private void ToggleButton_Checked(object sender, RoutedEventArgs e)
MessageBox.Show("f");
Main Window xaml:
<Window x:Class="ButtonChangeImage.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:m="clr-namespace:ButtonChangeImage"
Title="MainWindow" Height="350" Width="525">
<Grid>
<m:UserControl1 Click="ToggleButton_Checked" FirstImage="C:\Users\AmitL\Desktop\james-brown-010.jpg"></m:UserControl1>
</Grid>
</Window>
Thanks,
Amit. -
I have an apppliction in which i am painting icon , i have used jav.net.URL to get the path of the image.I 'm getting the path displayed in my console.When i use the same path to display my node,i t says that nullpointer exception ...i m sure that i have set the path and image is in the repective directory..Whatz wrong with this ..can anyone help? catergory is my tree node
String path="images/bell.gif";
java.net.URL imgURL = ObjectGroup.class.getResource(path);
System.out.println("image path"+imgURL);
category.setImageAt(new ImageIcon(ObjectGroup.class.
getResource("D:/rev/rl/classes/re/r/rcs/ri/coduct/images/bell.gif")), 0);String path="images/bell.gif";
java.net.URL imgURL =
RL imgURL = ObjectGroup.class.getResource(path);
System.out.println("image path"+imgURL);
category.setImageAt(new
ImageAt(new ImageIcon(ObjectGroup.class.
getResource("D:/rev/rl/classes/re/r/rcs/ri/coduct/imag
s/bell.gif")), 0);you should use the imgUrl...
category.setImageAt(new ImageAt(new ImageIcon(imgURL)),0);
should do it
Maybe you are looking for
-
Conflict: READ TABLE itab2 INDEX 1 vs Modify itab1 from index sy-tabix
The below simple code is for each itab1 line, create a new itab2 by using select statement, and then grab the max value of field f in itab2 and fill it into a corresponding field in itab1. However the statement: READ TABLE itab2 into gs_itab1 INDEX 1
-
Unable to start cs3 server on os x 10.6.3
After starting from a shell server terminates with following error: Sun Jun 6 12:28:11 2010 INFO [Server] Initialisierung Sun Jun 6 12:28:11 2010 INFO [Server] Anwendung wird geladen Sun Jun 6 12:28:11 2010 INFO [Server] Zusatzmodule werd
-
My audio gets out of sync with my video after capturing from Sony XDCAM
Everything was fine. I captured content from my Sony XDCAM, created pieces, no problem. Imported a .mov from my older FCP (5.1.4). FCP told me I needed to change my settings in order to use the .mov with my current timeline. I said OK, fine. Now, whe
-
Terminal Problems - Can't open a new full size window
When I open Terminal, I get a tiny little corner of a window that shows only the Red Close window button. All new windows open the same way. I can't enlarge the window by dragging or menu commands. The Terminal is basically worthless in this state. I
-
Converting 32bit binary to float
hi again, is there a simple method for converting a string representation of a 32-bit binary value into its corresponding floating point value? e.g. string s = "01000001110011100001010001111011" thanks in advance