I've been using Flex do do this for some time now and it works well:

http://www.adobe.com/devnet/coldfusion/articles/multifile_upload.html

It even checks filesizes before upload and allows multiple files in
one operation.

On Feb 2, 2008 4:41 PM, s. isaac dealey <[EMAIL PROTECTED]> wrote:
> > >>Put simply, you can't.
> >
> > Really?
> >
> > Check this out:
> > http://php5.bluga.net/UploadProgressMeter/demo.php
> >
> > Grumbles to self....
>
> Well that one isn't working for me with Firefox 2 and a 512kb file (says
> a 250kb file should be a good demo for most connections)... Instead I
> get "upload complete" pretty much instantly followed by a javascript
> error.
>
> However. If you get really creative, I would think you might be able to fake
> something that's semi accurate some of the time (when the weather is
> just right). Avoid trying to use Ajax to send the file -- that's liable
> to just frustrate you even more. Submit the form via an iframe instead
> and on the request that receives the form submission, check initially
> for the length of the request data using getHTTPRequestData()
>
> It's a rarely used function that almost nobody knows about (of course
> because it's rarely used) - here's the livedocs article
>
> http://livedocs.adobe.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=ColdFusion_Documentation&file=00000482.htm
>
> I *think* that you can fetch that prior to your cffile tag and use it to
> figure out how much data is coming up. Though you still would need to
> have a way of roughly figuring the user's connection speed, which with
> larger files will also fluctuate during an upload, and there won't be
> any way to really guage the fluctuation since you don't get any feedback
> from cf between the start and end of the cffile tag processing.
>
> So yeah, the short answer is still "no". The long answer is basically
> "not reliably the way you'd want it to work".
>
> This might not be a bad time to submit a feature request for CF9 to add
> an attribute or maybe a sub-tag to the cffile tag that would allow it to
> execute some kind of progress monitoring code at intervals. If for no
> other reason than that this question crops up pretty regularly on
> mailing lists. I would think something like:
>
> <cffile action="upload" filefield="yadda">
>   <cffileprogress interval="1000">
>     <cfset session.fileprogress = cffile.percentcomplete />
>   </cffileprogress>
> </cffile>
>
> That's a real crude, "off the top of my head" thought. Interval would be
> miliseconds, so it'd update the fileprogress once per second and then
> you'd use a series of ajax calls or the like at similar intervals to
> update the original page.
>
> All of which still hinges on my guess being correct that the page starts
> executing (or can) before all of the multi-part/formdata is finished
> transferring. I honestly don't know if the webserver will allow that.
>
> --
> s. isaac dealey  ^  new epoch
>  isn't it time for a change?
>      ph: 503.236.3691
>
> http://onTap.riaforge.org/blog
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:297986
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to