CodeCharge Studio
search Register Login  

Visual Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> ASP

 Implement a custom class

Print topic Send  topic

Author Message
DeanCovey


Posts: 22
Posted: 01/27/2008, 7:17 AM

What is the best way to incorporate http://www.planetsourcecode.com/vb/scripts/ShowCode.asp...d=9209&lngWId=4

The problem I run into the class is redefined here and on the page that needs to include it. Should I just modify the classes.asp file?


Class cAspImage :-O
'// MODULE VARIABLES
Private m_arrBytes'// Byte array holding the image file
Private m_lWidth'// Width in pixels
Private m_lHeight '// Height in pixels
Private m_iColorDepth'// Color Depth (BitsPerPixel)
View profile  Send private message
DeanCovey


Posts: 22
Posted: 01/27/2008, 7:19 AM

Also note: I am wanting to implement after a file upload has been processed.
View profile  Send private message
Edd


Posts: 547
Posted: 01/27/2008, 4:59 PM

Dean,

This is my way of doing this:
1. Create a separate class as stated in the example and put it where you have the classes.asp area.

2. Open the page you wish to this to be added and open the code to the page (not the events part but the generated gode area) and at the top slip in your additional class without affecting the rest of the page, e.g.

<%  
'Include Common Files @1-AED2A97A  
%>  
<!-- #INCLUDE FILE="Common.asp"-->  
<!-- #INCLUDE FILE="Cache.asp" -->  
<!-- #INCLUDE FILE="Template.asp" -->  
<!-- #INCLUDE FILE="Sorter.asp" -->  
<!-- #INCLUDE FILE="Navigator.asp" -->  
<%  
'End Include Common Files  
%>  
<!--#include file="cAspImage.asp"-->  
<%  
'Initialize Page @1-ABBE20FE  
' Variables  
..........etc  

3. In the AftterFileUpload event
  
Dim oAspImg  
Dim FileNamePath  
if DataSourceName.FileControlName.IsUploaded Then  
    Set oAspImg = New cAspImage  
    FileNamePath = DataSourceName.FileControlName.FileFolder & DataSourceName.FileControlName.value  
    With oAspImg  
                .ReadImage(FileNamePath)  
    	Response.Write "ImageSize: " & .ImageSize & "<BR />"  
    	Response.Write "Date Created: " & .DateCreated & "<BR />"  
    	Response.Write "Date Last Modified: " & .DateLastModified & "<BR />"  
    	Response.Write "ColorDepth: " & .ColorDepth & "<BR />"  
    	Response.Write "Width: " & .Width & "<BR />"  
    	Response.Write "Height: " & .Height & "<BR />"  
    	Response.Write "ImageType: " & .ImageType & "<BR />"  
    	Response.Write "Error Message: " & .ErrorMessage & "<BR />"  
    End With  
    Set oAspImg = Nothing  
End If  
  

This should give you a reasonable start on this.

Cheers - Edd
_________________
Accepting and instigating change are life's challenges.

http://www.syntech.com.au
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.

PHP Reports

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

Home   |    Search   |    Members   |    Register   |    Login


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