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 -> General/Other

 File Upload - Can't upload binary files

Print topic Send  topic

Author Message
Ozum
Posted: 03/22/2004, 4:36 AM

Hi,

CCS 2.2.3.60, Windows XP, Perl 5.8.3, MySQL 4, Apache 1.3, mod Perl 1.29

I put a file upload component in my record form and have 2 problems related to file upload mechanism

1. Binary files at the server side are corrupted after uploading them. (Tested jpg files appear corrupted, ms excel files don't open, excel complains file can not be open, when a simple txt file, problem doesn't appear.)

2. When I choose a file to upload the original file I selected is removed from my system after upload.

I guess first one is related to bin mode of perl file handle. Where to configure CCS ? Or how can I eliminate the problems ?
Ozum
Posted: 03/22/2004, 1:08 PM

Hi again,

When I modify classes.pm file genrated by CCS, the problem with corrupt file dissapears, but changing the file everytime I publish a project is very cumbersome.

This is a bug in CCS related to PERL. On Windows based machines binary files should be processed with "binmode FILEHANDLE".

In classes.pm file;
After Line 934
$UploadedFile = $cgi->upload($FileControl);  
should be
$UploadedFile = $cgi->upload($FileControl);  
binmode $UploadedFile;  
After Line 997
if( open (TMPFILE, ">>" . $self->{TemporaryFolder} . $ActualFileName) ) {  
should be
if( open (TMPFILE, ">>" . $self->{TemporaryFolder} . $ActualFileName) ) {  
binmode TMPFILE;  

Again changing classes.pm everytime is very annoying and
can't still find a solution to 2nd problem.
DonB
Posted: 03/23/2004, 5:31 AM

I don't speak Perl, but it sounds like you should be using your own class
that inherits the CCS class - so that you can implement binmode and override
the default behavior.

Is this not possible?

--
DonB

http://www.gotodon.com/ccbth


"Ozum" <Ozum@forum.codecharge> wrote in message
news:2405f55eac14c2@news.codecharge.com...
> Hi again,
>
> When I modify classes.pm file genrated by CCS, the problem with corrupt
file dissapears, but changing the file everytime I publish a project is very
cumbersome.
>
> This is a bug in CCS related to PERL. On Windows based machines binary
files should be processed with "binmode FILEHANDLE".
>
> In classes.pm file;
> After Line 934
>
$UploadedFile = $cgi->upload($FileControl);  
> 
> should be
>
$UploadedFile = $cgi->upload($FileControl);  
> binmode $UploadedFile;  
> 
> After Line 997
>
if( open (TMPFILE, ">>" . $self->{TemporaryFolder} .  
$ActualFileName) ) {  
> 
> should be
>
if( open (TMPFILE, ">>" . $self->{TemporaryFolder} .  
$ActualFileName) ) {  
> binmode TMPFILE;  
> 
>
> Again changing classes.pm everytime is very annoying and
> can't still find a solution to 2nd problem.
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

Ozum
Posted: 03/24/2004, 4:00 AM

It is unfortunately a bug, because the PERL code produced by CCS related to file upload component is useless on windows machines without that modification.

I try to modify Components\CodeTemplates\PerlTemplates\Site\classes.ccl to let CCS produce right code but it is uneditable format.
DonB
Posted: 03/24/2004, 4:43 AM

But what about inheriting that class, from one that you write yourself?
http://iis1.cps.unizar.es/Oreilly/perl/cookbook/ch13_13.htm

--
DonB

http://www.gotodon.com/ccbth


"Ozum" <Ozum@forum.codecharge> wrote in message
news:24061787b09913@news.codecharge.com...
> It is unfortunately a bug, because the PERL code produced by CCS related
to file upload component is useless on windows machines without that
modification.
>
> I try to modify Components\CodeTemplates\PerlTemplates\Site\classes.ccl to
let CCS produce right code but it is uneditable format.
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

kjhkjhlkj
Posted: 03/24/2004, 12:21 PM

Quote DonB:
But what about inheriting that class, from one that you write yourself?
http://iis1.cps.unizar.es/Oreilly/perl/cookbook/ch13_13.htm

--
DonB

http://www.gotodon.com/ccbth


"Ozum" <Ozum@forum.codecharge> wrote in message
news:24061787b09913@news.codecharge.com...
> It is unfortunately a bug, because the PERL code produced by CCS related
to file upload component is useless on windows machines without that
modification.
>
> I try to modify Components\CodeTemplates\PerlTemplates\Site\classes.ccl to
let


:-/ :-/:( :(:-) :-):-) :-):-) :-) jhgjhgjh g :-{}

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.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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