Mailing List Archive

Uploading File writes zero bytes
Hi ALL,

I am having a hell of a time trying to get a file to upload. The file gets
created and then nothing gets put into the file!

Here is my code:

<H1 ALIGN="CENTER"><img src="../misc/csc_logo_neon.png" width="102"
height="49" align="left">Incidents Reports &ndash; New Report: Upload
Additional Files</H1>

<HR>

<P STYLE="margin-left: 2in">The file you enter in the following text box
will be uploaded to the /tmp directory if you hit the "upload
file"button.<BR>
</P>

[$ if !defined $fdat{ImageName} $]
<FORM METHOD="POST" ENCTYPE="multipart/form-data"
ACTION="upload.html">
<P STYLE="margin-left: 2in">
<INPUT TYPE="FILE" NAME="ImageName">
<INPUT TYPE="SUBMIT" NAME="Submit" VALUE="Upload file">
</P>
</FORM>
[$else$]

[.-
use DBI;
use CGI;

$req = shift;
my $upload = CGI->new();


$udat{incidentnumber} = 9;

$filenamesent = $fdat{ImageName};

open FILE, "> /tmp/file.$$";
binmode FILE;
print FILE $buffer
while read($fdat{ImageName}, $buffer, 32768);
close FILE;

-]

<P STYLE="margin-left: 2in">
Your file has been saved to [+ $pathfile +]
<br>
Your file has been saved to [+ $fdat{ImageName} +]
<br>
</P>
<FORM METHOD="GET">
<P STYLE="margin-left: 2in"><INPUT TYPE="SUBMIT" NAME="Submit"
VALUE="Upload new file"></P>
</FORM>


[$endif$]


And here is what I get for attempting :)
-rw-r--r-- 1 http http 0 Mar 20 17:59 file.25739
-rw-r--r-- 1 http http 0 Mar 20 18:07 file.4973
-rw-r--r-- 1 http http 0 Mar 20 17:33 file.5393


Any ideas?


Keven Murphy
murphyk@gdls.com

Murphy's Law
((U+C+I)x(10-S))/20xAx1/(1-sin(F/10))
U = Urgency C = Complexity
I = Importance S = Skill
F = Frequency A = Aggravation


This is an e-mail from General Dynamics Land Systems. It is for the intended recipient only and may contain confidential and privileged information. No one else may read, print, store, copy, forward or act in reliance on it or its attachments. If you are not the intended recipient, please return this message to the sender and delete the message and any attachments from your computer. Your cooperation is appreciated.

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: Uploading File writes zero bytes [ In reply to ]
On Mon, Mar 20, 2006 at 06:09:30PM -0500, Keven Murphy wrote:
> I am having a hell of a time trying to get a file to upload. The file gets
> created and then nothing gets put into the file!

That sounds like a CGI version issue - there was an upload problem with some
of the early 3.0's, from memory - try upgrading CGI to the latest and see if
it goes away.

Cheers,
Gavin


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: Uploading File writes zero bytes [ In reply to ]
On Mo, 2006-03-20 at 18:09 -0500, Keven Murphy wrote:

> [-
> use DBI;
> use CGI;
>
> $req = shift;
> my $upload = CGI->new();

Remove the line above. $upload is never used anyway, and there have
been some issues in the past about CGI clashing Embperl's reading
of the request parameters. I just dumped CGI.pm altogether (in Embperl
pages) and never regretted it.

Hth,
Torsten


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: Uploading File writes zero bytes [ In reply to ]
Gavin,

I am using version CGI 3.17 and embperl 1.3.6.

Keven Murphy

Murphy's Law
((U+C+I)x(10-S))/20xAx1/(1-sin(F/10))
U = Urgency C = Complexity
I = Importance S = Skill
F = Frequency A = Aggravation

On Tue, 21 Mar 2006, Gavin Carr wrote:

> On Mon, Mar 20, 2006 at 06:09:30PM -0500, Keven Murphy wrote:
> > I am having a hell of a time trying to get a file to upload. The file gets
> > created and then nothing gets put into the file!
>
> That sounds like a CGI version issue - there was an upload problem with some
> of the early 3.0's, from memory - try upgrading CGI to the latest and see if
> it goes away.
>
> Cheers,
> Gavin
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> For additional commands, e-mail: embperl-help@perl.apache.org
>
>


This is an e-mail from General Dynamics Land Systems. It is for the intended recipient only and may contain confidential and privileged information. No one else may read, print, store, copy, forward or act in reliance on it or its attachments. If you are not the intended recipient, please return this message to the sender and delete the message and any attachments from your computer. Your cooperation is appreciated.

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: Uploading File writes zero bytes [ In reply to ]
I gave that a try too. I am still uploading zero byte files.

Thanks,
Keven Murphy
murphyk@gdls.com

Murphy's Law
((U+C+I)x(10-S))/20xAx1/(1-sin(F/10))
U = Urgency C = Complexity
I = Importance S = Skill
F = Frequency A = Aggravation

On Tue, 21 Mar 2006, Torsten Luettgert wrote:

> On Mo, 2006-03-20 at 18:09 -0500, Keven Murphy wrote:
>
> > [-
> > use DBI;
> > use CGI;
> >
> > $req = shift;
> > my $upload = CGI->new();
>
> Remove the line above. $upload is never used anyway, and there have
> been some issues in the past about CGI clashing Embperl's reading
> of the request parameters. I just dumped CGI.pm altogether (in Embperl
> pages) and never regretted it.
>
> Hth,
> Torsten
>
>


This is an e-mail from General Dynamics Land Systems. It is for the intended recipient only and may contain confidential and privileged information. No one else may read, print, store, copy, forward or act in reliance on it or its attachments. If you are not the intended recipient, please return this message to the sender and delete the message and any attachments from your computer. Your cooperation is appreciated.

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
RE: Uploading File writes zero bytes [ In reply to ]
Hi,

>
> I am using version CGI 3.17 and embperl 1.3.6.
>

If I remember right Embperl 1.3.6 needs CGI < 3 (while Embperl 2, when
running with mod_perl 2 needs CGI >= 3.10)

Note that Embperl 1.3.x is not longer maintained anymore, so I suggest to
upgrade to Embperl 2 if possible

Gerald




** Virus checked by BB-5000 Mailfilter **


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org