CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 [resolved - After file process catching the height and weight of an image ]

Print topic Send  topic

Author Message
CodeChargeMVP

Posts: 473
Posted: 06/20/2011, 3:40 AM

Hi,

On the after file process I�m catching the size of an image this way:

$ImagenJPG = imagecreatefromjpeg("../template/images/justificantes/".$NombreArchivoNuevo);
$justgasto->H_AnchuraImagen->Value = imagesx($ImagenJPG);
$justgasto->H_AlturaImagen->Value = imagesy($ImagenJPG);

Than I catch the image height and weight and put into a hidden object, to

do some manipulations with this parameters but when checking the values of

the hidden buttons on the client side this way:

var AnchuraImagen = document.forms[0].elements["H_AnchuraImagen"].value;
var AlturaImagen = document.forms[0].elements["H_AlturaImagen"].value;

alert(AnchuraImagen);
alert(AlturaImagen);

the variables return nothing, no values on the hidden objects.

I know for sure than on the PHP Side the image exists, and than the fuctions returns some values, i don�t know why I can�t access to them later on the client side.

�Any suggestion?

Thank you very much in advance.
_________________
Best Regards
Entrepeneur | NT Consultant
View profile  Send private message
CodeChargeMVP

Posts: 473
Posted: 06/20/2011, 4:03 AM

Hi,

I think this is not possible to resolve that way, when the user saves the file

on the after file process, yes I can access to height and weight but I´ve release

than after that I should click on save button form by update it so the values on

the hidden object obviously gone so I can´t handle them.

I think this also would solved with an ajax solution.
_________________
Best Regards
Entrepeneur | NT Consultant
View profile  Send private message
jjrjr2


Posts: 131
Posted: 06/20/2011, 8:05 AM

Hi

Could you be a little more clear as to what You are wanting to do???


_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com
Real Web Development At: http://RealWebDevelopment.us
View profile  Send private message
CodeChargeMVP

Posts: 473
Posted: 06/21/2011, 2:05 AM

Hi,

I think the issue gotta be resolved using the event "before show" of the FileUpload componenent,but I´ve a question about it:

on the before show event i´m doing this:

$ImagenJPG = imagecreatefromjpeg("../template/images/justificantes/"."imagen.jpg");
$justgasto->H_AnchuraImagen->Value = imagesx($ImagenJPG);
$justgasto->H_AlturaImagen->Value = imagesy($ImagenJPG);

This works out, but I need a php sentence which return me the filename of the file on the FileUpload component, than I´ll change "imagen.jpg" for that sentence.

¿Do you know how get the filename with a php sentence?

Thank you very much in advance.


Quote jjrjr2:
Hi

Could you be a little more clear as to what You are wanting to do???



_________________
Best Regards
Entrepeneur | NT Consultant
View profile  Send private message
jjrjr2


Posts: 131
Posted: 06/21/2011, 6:43 AM

As you know the filename in the file upload component is the actual filename CCS used to upload the file..

The upload component uploads the file & adds a time stamp to it.. Sooo... the file actually uploaded is like so

timestamp.originaluploadname.ext

That is also what is placed into the database for the file name

To get back the original filename you do it like so.

$OriginalFileName=CCGetOriginalFileName($Container->YourFileUploadComponentName->GetValue());

Hope that helps for what U R trying to do..

John
8-)
_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com
Real Web Development At: http://RealWebDevelopment.us
View profile  Send private message
CodeChargeMVP

Posts: 473
Posted: 06/22/2011, 3:30 AM

Hi John,

Thank you very much for your help,

I catched the file name with $nameoftheform->$nameofthefileupload->getfilename();

than everything came on a flash.

The timestamp issue wasn´t a problem.

Now is solved.

Quote jjrjr2:
As you know the filename in the file upload component is the actual filename CCS used to upload the file..

The upload component uploads the file & adds a time stamp to it.. Sooo... the file actually uploaded is like so

timestamp.originaluploadname.ext

That is also what is placed into the database for the file name

To get back the original filename you do it like so.

$OriginalFileName=CCGetOriginalFileName($Container->YourFileUploadComponentName->GetValue());

Hope that helps for what U R trying to do..

John
8-)

_________________
Best Regards
Entrepeneur | NT Consultant
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.