[prev in list] [next in list] [prev in thread] [next in thread]
List: mason
Subject: Re: [Mason] Upload Question
From: "Michael W. Zaskey, CTS" <mwz () zasco ! com>
Date: 2014-01-07 4:22:09
Message-ID: 77fc80162d194cc7a03cb50df7e8682d () CO1PR06MB393 ! namprd06 ! prod ! outlook ! com
[Download RAW message or body]
Ryan,
Thank you so much for tip. It wasn't the total fix for me, but it led me down the \
right track and ultimately success.
I tried the code sample you suggested, and was able to get to a point where the \
upload would complete, but the resulting HTML page sent back simply said: "End of \
file found". (no Mason or Perl errors)
I was stuck for a moment, but then searched the web a bit, and ran across:
http://perl-hunting.blogspot.com/2010/01/htmlmason-and-apache-issues.html
Which clued me in to adding:
PerlSetVar MasonArgsMethod mod_perl
In my perl.conf file such as in:
PerlModule HTML::Mason::ApacheHandler
<LocationMatch "(\.mpl)$">
SetHandler perl-script
PerlHandler HTML::Mason::ApacheHandler
PerlSetVar MasonArgsMethod mod_perl
</LocationMatch>
I remembered that we had to add that line a long time ago on the old server.
After adding it and restarting Apache, your new script worked. Then I actually \
reverted back to the original programmers code to test, and that worked again as \
well.
So, I reverted back to the original code, (for consistency) and all is working \
perfectly.
Again, THANK YOU for the tip and the inspiration to keep learning and finding the \
answers to keeping our old website alive.
All the best in 2014.
Michael
-----Original Message-----
From: Ryan Perry [mailto:rperry@madisonip.com]
Sent: Sunday, December 29, 2013 3:31 PM
To: Michael W. Zaskey, CTS
Cc: mason-users@lists.sourceforge.net
Subject: Re: [Mason] Upload Question
Oops, didn't mean to hit send yet, but you can see more here:
http://search.cpan.org/~isaac/libapreq2-2.13/glue/perl/lib/Apache2/Upload.pm
On Sun, Dec 29, 2013 at 2:28 PM, Ryan Perry <rperry@madisonip.com> wrote:
> You could try:
>
> if (($key =~ /new_file_(\d+)/) && $ARGS{'new_file_'.$1}) {
>
> use Apache2::Upload;
>
> my $req = Apache2::Request->new($r);
> my $upload = $req->upload("foo");
> my $size = $upload->size;
>
> # three methods to get at the upload's contents ... slurp, fh, io
>
> $upload->slurp($slurp_data);
>
> read $upload->fh, $fh_data, $size;
> ok $slurp_data eq $fh_data;
>
>
>
> On Sun, Dec 29, 2013 at 10:51 AM, Michael W. Zaskey, CTS <mwz@zasco.com> wrote:
> > Hello,
> >
> > I have a site that was built on Mason several years ago. It has worked fine on \
> > the old server (Apache 1) and was recently migrated to a new server (Apache2) and \
> > we were able to make nearly all pages work perfectly except the original upload \
> > code for my images on the back end. Unfortunately the original programmer is no \
> > longer available, and I have limited knowledge (other then what I have learned \
> > during troubleshooting various issues and updating some features over the years). \
> > I am hoping someone may be able the give me a clue on this error or provide a \
> > snip of known working code for me to test with.
> >
> >
> >
> > error: Can't locate object method "upload" via package "Apache2::RequestRec" at \
> > /home/~path and file edited for post~.mpl line 60.
> > context: ...
> > 56: }
> > 57: if (($key =~ /new_file_(\d+)/) && $ARGS{'new_file_'.$1}) {
> > 58:
> > 59:
> > 60: my $upload = $r->upload('new_file_'.$1);
> > 61:
> > 62: #create a unique filename
> > 63: $SQL = "SELECT nextval('file_name_seq')";
> > 64: my $file_seq = $db->selectrow_array($SQL);
> >
> >
> >
> >
> > Thank you,
> >
> > Michael
> >
> > ***New for Fall 2013: New England's Premier Visual Display System! Our new Oracle \
> > LED Systems Black Widow HD9 large-format indoor/outdoor LED video displays \
> > feature 9mm resolution, 7000 nit brightness, and a wide variety of configurations \
> > for every application. Visit our \
> > website<http://www.zasco.com/av_led_displays.html> to learn more.
> > ---------------------------------------------------------------------
> > --------- Rapidly troubleshoot problems before they affect your
> > business. Most IT organizations don't have a clear picture of how
> > application performance affects their revenue. With AppDynamics, you
> > get 100% visibility into your Java,.NET, & PHP application. Start
> > your 15-day FREE TRIAL of AppDynamics Pro!
> > http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.
> > clktrk _______________________________________________
> > Mason-users mailing list
> > Mason-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/mason-users
>
>
>
> --
> Ryan Perry
--
Ryan Perry
***New for Fall 2013: New England's Premier Visual Display System! Our new Oracle LED \
Systems Black Widow HD9 large-format indoor/outdoor LED video displays feature 9mm \
resolution, 7000 nit brightness, and a wide variety of configurations for every \
application. Visit our website<http://www.zasco.com/av_led_displays.html> to learn \
more.
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic