I am currently using a CGI method you describe and it does work. However, I 
want a  Mason solutions so can access some session variable I placed in cache 
and use my mason authentication process.   I find it hard to believe that it is 
not possible to create a  file upload progress bar with in the mason frame 
work.  Is their a way I can go about  modifying the mason template engineer to 
provide me with the desire results?   I feel this is common feature and mason 
should have it if it's is still going to be considered as a development  
framework/platform.

Scott

From: Christofer Abrahamsson [mailto:c...@ca84.com]
Sent: Tuesday, November 09, 2010 10:20 PM
To: Scott Dolan
Subject: Re: [Mason] Mason File Upload Progress Bar

Use the cgi:ajax fetch source from perlmonks.
perl code example: http://pastebin.com/mKDML4hx

btw, the code don't print/show unique id key, and of my knowledge there is no 
transfer byte couter written for mason template engine.

//c
On Wed, Nov 10, 2010 at 12:11 AM, Scott Dolan 
<sdo...@v12groupinc.com<mailto:sdo...@v12groupinc.com>> wrote:
Chris,
    Thanks,  I have already both of those articles. Unfortunately, the 
information in them only explain how to read a file after it has complete the 
uploading process.  I need way to  count the data bytes being transfer during 
the request.


//upload with no progress bar....
<%args>
$myfile
</%args>

<%once>
  use CGI qw(:standard);
  use CGI::Util;
</%once>

<%init>
  my $query = $m->cgi_object;
  my $fh       = $query->upload("yourfile");

  #Selects the directory from .htaccess
  my $dir = $ENV{'UPLOAD_TMPDIR'};

  #copy files to hard drive and rename to job number
  open FILE, "> $dir/UploadFile" or $m->print("<p>File Open Failed!  $!</p>");

  while (<$fh>)
  {
                $m->print("<p>$_</p>");
  }
  close($fh);
  close(FILE);
</%init>


From: Christofer Abrahamsson [mailto:c...@ca84.com<mailto:c...@ca84.com>]
Sent: Tuesday, November 09, 2010 5:57 PM
To: Scott Dolan
Subject: Re: [Mason] Mason File Upload Progress Bar

Maybe this url's is helpful for you.

http://search.cpan.org/~lgoddard/CGI-ProgressBar-0.04/ProgressBar.pm<http://search.cpan.org/%7Elgoddard/CGI-ProgressBar-0.04/ProgressBar.pm>
http://www.masonhq.com/?FAQ:HTTPAndHTML#h-how_can_i_handle_file_uploads_under_mason_

//c
On Tue, Nov 9, 2010 at 9:22 PM, Scott Dolan 
<sdo...@v12groupinc.com<mailto:sdo...@v12groupinc.com>> wrote:
                I need to add a  file upload with a progress bar page to my 
website that I developed with Mason.  I am already have standard file upload 
working that I implemented with  mason.
                I found couple perl cgi scripts that provide a file uploads 
with progress bar.  This scripts all seem to use callback hook function  my $q 
= new CGI (\&hook);  sub hook{   my ($filename,$buffer,$bytes_read,$file) = @_; 
 ...};   This works great in CGI. However, The problem is that mason 
page/component does not seem to execute unitl after the file upload transfer 
process has completed.  So, the hook function will not work.   Is there a way 
to turn off this capablity?  Where is the file upload process handle and 
execute within mason?
                Mason seems to wait until the file upload process is complete 
before the call the component/page. Where does this all take place and is there 
a way to change it?   I think  it makes sense to update source code to handle 
this type of transacts.

Scott
732-300-9956



-

------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a
Billion" shares his insights and actions to help propel your
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net<mailto:Mason-users@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/mason-users


------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to