CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 image upload and veiw

Print topic Send  topic

Author Message
milind

Posts: 10
Posted: 05/07/2009, 3:22 AM

Hi all,

I have add/edit employee form where I can upload image of employee.
Storing image in database and in 'photos' folder is happening fine.

I am willing to get image for viewing when I try to edit the employee where I can see delete checkbox and other image related information but not the image for viewing purpose.I want to show image of employee.

Help needed

thxx
View profile  Send private message
damian

Posts: 838
Posted: 05/07/2009, 5:06 AM

right click on image label and change it to an image. adjust properties (mainly path) as required
_________________
if you found this post useful take the time to help someone else.... :)
View profile  Send private message
milind

Posts: 10
Posted: 05/07/2009, 6:13 AM

thxx damian for quick response

I will clear my need once again
While uploading I have file uploader.
I add and upload employee photo successfully
After clicking edit link next to that added record, I see image file name without datetime string eg emp_one.jpg and its size in bytes and very next checkbox to delete image file. Delete is working fine.
Instead of image file name and its size, I want there photograph to be displayed like in <img src="" />

How can I bring dynamic img part there?
View profile  Send private message
damian

Posts: 838
Posted: 05/07/2009, 6:26 AM

right click on image label and change it to an image. adjust properties (mainly path) as required....

_________________
if you found this post useful take the time to help someone else.... :)
View profile  Send private message
melvyn


Posts: 333
Posted: 05/07/2009, 8:19 AM

Quote damian:
right click on image label and change it to an image. adjust properties (mainly path) as required....

The image component don't display a field which you can change. It's a dynamic control.

The simpler solution is to add a label near the upload control, change its type to image according to Damian's recomendation and you'll have the two fields there: one for viewing (imagen) and the another for editing.
_________________
Melvyn Perez
Puro Codigo
http://purocodigo.com
View profile  Send private message
milind

Posts: 10
Posted: 05/07/2009, 11:10 PM

Thxx malvyn and damian

I did what melvyn has mentioned in his post.
I have also added Before show event code

//Custom Code @51-2A29BDB7
$emp_id = trim($_GET["emp_id"]);
if($emp_id== ""){
$employees->Label1->Visible = False;
}
//End Custom Code

It served my purpose

Improvements in above code are welcome

thxx

View profile  Send private message
milind

Posts: 10
Posted: 05/08/2009, 2:48 AM

Here is improved Before show event code
Which checks new record, existence of image file and accordingly gives the result

//Custom Code @51-2A29BDB7
// Read user_id from URL
$EmpId = CCGetFromGet("emp_id", 0);
$PictureValue = $employees->picture->GetValue();

//PhotosRootPath is physical path to images stored in folder and set as
//constant in common.php
$PotoFile = PhotosRootPath.$PictureValue;
if($EmpId == 0) {
$employees->Label1->Visible = False;
} else {
if(!file_exists($PotoFile)){
$employees->Label1->Visible = False;
}
}
//End Custom Code

thxx
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.