Re: [PHP] APC - Upload progress problem. apc
On Sep 17, 2009, at 12:27 AM, Ben Dunlap wrote: upload keys, and any keys created via apc_add(). This listing includes a Timeout value, which is none for the apc_add keys and 3600 for the upload keys. Somewhat suspicious, I'd say, since the keys stop being working after 1 hour of use. APC lets you set a number of timeout values: apc.gc_ttl, apc.user_ttl, apc.ttl. I have set all of these to be gianormous, but the upload key timeout value never changes. I can't believe that this is an inherent limitation, or nobody would be using this. The Google claims people are using this for big uploads, so I I've just had my first glance at the APC source code, so I could be misreading something, but it appears that 3600 was hardcoded in until about 3 weeks ago. Here's the trunk commit that seems to have made that value configurable: http://svn.php.net/viewvc?view=revisionrevision=287534 And there's a reference to a PECL bug in the commit message: http://pecl.php.net/bugs/bug.php?id=16717 I have no idea when this change will trickle through to a production build -- or if it already has, but I suspect not, because the hardcoded 3600 was still present in the latest available source code tarball at http://pecl.php.net/get/APC Ben Ben: Thank you so much, I felt like I was on crazy pills! I was afraid it was a bug. I have generally just used whatever is at whatever host, until this project, and didn't really think something so glaring could be in there. WTF! So, it seems like it would be pretty straight forward to fix this, if I was willing to run on a custom version until this fix is released. Do people do that? What do you think? The alternative is starting over with python or perl. Sheesh! Phred -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] APC - Upload progress problem. apc
I was afraid it was a bug. I have generally just used whatever is at whatever host, until this project, and didn't really think something so glaring could be in there. WTF! I wonder if massive uploads, like the ones you're coding for, really aren't that common. I can imagine hard-coding that 3600 myself, and thinking, no way someone's going to be uploading a single file for longer than an hour, or even close to it. So, it seems like it would be pretty straight forward to fix this, if I was willing to run on a custom version until this fix is released. Do people do that? What do you think? After looking at it bit more, I found another PECL bug, same basic underlying problem, that was fixed almost a year ago: http://pecl.php.net/bugs/bug.php?id=14198 That's when the config option apc.rfc1867_ttl was introduced to APC -- but some of that hardcoded 3600 remained until a few weeks ago. The older bug (14198) sounds exactly like your problem, so if I were you I'd start by trying any of the official versions that include the fix for 14198. That fix was committed on August 29 of 2008: http://svn.php.net/viewvc?view=revisionrevision=265595 So the next version up (3.1.1) from what you're currently using will include it. I guess 3.1.1 is still in beta but I'd personally go for beta over a custom build, at least on a first pass. Ben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] APC - Upload progress problem. apc
I wonder if massive uploads, like the ones you're coding for, really aren't that common. I can imagine hard-coding that 3600 myself, and thinking, no way someone's going to be uploading a single file for longer than an hour, or even close to it. me too, also because for a silly connection problem you could even re-start the upload from the scratch. I do not think HTTP and a POST form as is is suitable for these kind of tasks, I would rather think about a truly simple Desktop software, Python for portability or AutoIT if it is only for windows, able to split the file in chunks 2 Mb each and open a conversation with the server in order to be able to resume the upload if something goes wrong or if the user would like to. With a desktop application you can send credentials and the SHA1 of the file in order to create it's ghost image on the server. Every chunk will be saved a part and when finished appended via file pointers to the main one. To allow a resume you simply need to communicate the current big file size / 2 Mb and you know which chunk needs to be uploaded. It is more simple to do than to explain, if you got this basic example about how to proceed, but you need privileges over the file in order to create a SHA1 and read only chunks via pointer, rather than send everything in a shot. Regards _ More than messages–check out the rest of the Windows Live™. http://www.microsoft.com/windows/windowslive/
Re: [PHP] APC - Upload progress problem. apc
On Sep 17, 2009, at 2:09 PM, Andrea Giammarchi wrote: I wonder if massive uploads, like the ones you're coding for, really aren't that common. I can imagine hard-coding that 3600 myself, and thinking, no way someone's going to be uploading a single file for longer than an hour, or even close to it. me too, also because for a silly connection problem you could even re-start the upload from the scratch. I do not think HTTP and a POST form as is is suitable for these kind of tasks, I would rather think about a truly simple Desktop software, Python for portability or AutoIT if it is only for windows, able to split the file in chunks 2 Mb each and open a conversation with the server in order to be able to resume the upload if something goes wrong or if the user would like to. With a desktop application you can send credentials and the SHA1 of the file in order to create it's ghost image on the server. Every chunk will be saved a part and when finished appended via file pointers to the main one. To allow a resume you simply need to communicate the current big file size / 2 Mb and you know which chunk needs to be uploaded. It is more simple to do than to explain, if you got this basic example about how to proceed, but you need privileges over the file in order to create a SHA1 and read only chunks via pointer, rather than send everything in a shot. Regards Woo hoo! Got php-apc patched and am testing now. Good points about long downloads, but right now folks are using FTP and they don't like it or understand it. In a biz environment, connections are pretty stable, and usually fairly fast. This gives them a familiar interface to upload. Anyway, this was the spec I was given. Adding interruption recovery is a nice phase 2, upgrade. I am just happy it is working now. The APC upload progress thing works great (above mentioned limitations aside). Long haul, but pretty slick in the end. Thanks again for all y'alls help. Phred -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] APC - Upload progress problem. apc
He's back... Well folks.. The good news is that APC and my upload progress is working! : ) The bad news is, ...kind of working. : | It does exactly what I want, but at 1 hour of progress-barring, it stops. I.e., APC stops returning a response for the given key. Whether the connection has allowed 100MB, 500MB or 1GB. The file actually continues to upload, for hours if necessary, and eventually gets there. APC provides a sort of management page that lets you look at the APC status, including a listing of User Cache Entries which includes any still-valid upload keys, and any keys created via apc_add(). This listing includes a Timeout value, which is none for the apc_add keys and 3600 for the upload keys. Somewhat suspicious, I'd say, since the keys stop being working after 1 hour of use. APC lets you set a number of timeout values: apc.gc_ttl, apc.user_ttl, apc.ttl. I have set all of these to be gianormous, but the upload key timeout value never changes. I can't believe that this is an inherent limitation, or nobody would be using this. The Google claims people are using this for big uploads, so I should be able to. I have looked through Apache/unix to see if this limit refers to something set deeper in the system, but everything that I know of that I can loosen up, I have. Any ideas? Thanks, Phred On Sep 15, 2009, at 8:51 AM, Nathan Nobbe wrote: On Tue, Sep 15, 2009 at 12:05 AM, Phred White phpl...@planetphred.comwrote: Folks: Thanks for all your help and suggestions. Miracle of miracles I am now getting a response,so I can start some level of debugging. I am not sure exactly what has been going on. I NEVER got a response, then I did - when I tried uploading some different files. It seems that larger files always give a negative response for me. Now I am thinking that it has been a timing issue. My ajax stuff doesn't repeat yet, so there is currently only one request. It seems that if the file is a little too large, the first response is always false, that may be the case for very small files too. I finally just picked a file that was the right size. Since I could never verify that APC was responding, it didn't occur to me to go ahead and iron out the ajax stuff. Anyway now I can move forward. Thanks all for all your suggestions, sorry this ends up being such a stupid conclusion. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] APC - Upload progress problem. apc
Phred White wrote: He's back... Well folks.. The good news is that APC and my upload progress is working! : ) The bad news is, ...kind of working. : | It does exactly what I want, but at 1 hour of progress-barring, it stops. I.e., APC stops returning a response for the given key. Whether the connection has allowed 100MB, 500MB or 1GB. The file actually continues to upload, for hours if necessary, and eventually gets there. APC provides a sort of management page that lets you look at the APC status, including a listing of User Cache Entries which includes any still-valid upload keys, and any keys created via apc_add(). This listing includes a Timeout value, which is none for the apc_add keys and 3600 for the upload keys. Somewhat suspicious, I'd say, since the keys stop being working after 1 hour of use. APC lets you set a number of timeout values: apc.gc_ttl, apc.user_ttl, apc.ttl. I have set all of these to be gianormous, but the upload key timeout value never changes. I can't believe that this is an inherent limitation, or nobody would be using this. The Google claims people are using this for big uploads, so I should be able to. I have looked through Apache/unix to see if this limit refers to something set deeper in the system, but everything that I know of that I can loosen up, I have. Any ideas? Thanks, Phred Are you using SESSIONS or COOKIES at all in this application? If so, could it possibly be related to one or the others timeout configuration? -- Jim Lucas Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them. Twelfth Night, Act II, Scene V by William Shakespeare -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] APC - Upload progress problem. apc
upload keys, and any keys created via apc_add(). This listing includes a Timeout value, which is none for the apc_add keys and 3600 for the upload keys. Somewhat suspicious, I'd say, since the keys stop being working after 1 hour of use. APC lets you set a number of timeout values: apc.gc_ttl, apc.user_ttl, apc.ttl. I have set all of these to be gianormous, but the upload key timeout value never changes. I can't believe that this is an inherent limitation, or nobody would be using this. The Google claims people are using this for big uploads, so I I've just had my first glance at the APC source code, so I could be misreading something, but it appears that 3600 was hardcoded in until about 3 weeks ago. Here's the trunk commit that seems to have made that value configurable: http://svn.php.net/viewvc?view=revisionrevision=287534 And there's a reference to a PECL bug in the commit message: http://pecl.php.net/bugs/bug.php?id=16717 I have no idea when this change will trickle through to a production build -- or if it already has, but I suspect not, because the hardcoded 3600 was still present in the latest available source code tarball at http://pecl.php.net/get/APC Ben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] APC - Upload progress problem. apc
Folks: Thanks for all your help and suggestions. Miracle of miracles I am now getting a response,so I can start some level of debugging. I am not sure exactly what has been going on. I NEVER got a response, then I did - when I tried uploading some different files. It seems that larger files always give a negative response for me. Now I am thinking that it has been a timing issue. My ajax stuff doesn't repeat yet, so there is currently only one request. It seems that if the file is a little too large, the first response is always false, that may be the case for very small files too. I finally just picked a file that was the right size. Since I could never verify that APC was responding, it didn't occur to me to go ahead and iron out the ajax stuff. Anyway now I can move forward. Thanks all for all your suggestions, sorry this ends up being such a stupid conclusion. Your, phred On Sep 14, 2009, at 8:33 PM, Nathan Nobbe wrote: On Mon, Sep 14, 2009 at 4:50 PM, Phred White phpl...@planetphred.comwrote: Andrea: I have in my php.ini: apc.rfc1867 = On apc.rfc1867_freq = 10K The apc.php diagnostic/report page says it is on. It just returns false. I will look at your zip file and see if something jumps out. what about your other apc.rfc1867 settings? are you posting the correct field to the server to tell apc to start tracking, and also are you grabbing the correct value when trying to determine the status in your progress tracking script? by default, your form needs an input like, input type=hidden name=APC_UPLOAD_PROGRESS id=progress_key value=?php echo $id?/ then in the progress checking script you will need something like, ?php if(isset($_GET['progress_key'])) { $status = apc_fetch('upload_'.$_GET['progress_key']); echo $status['current']/$status['total']*100; } ? the names of these variables depend upon apc.rfc1867_name and apc.rfc1867_prefix respectively. take a look at this article, it was really helpful, http://www.ibm.com/developerworks/opensource/library/os-php-v525/ also, to get going fast, dont bother w/ the progress script yet. just focus on getting apc to start tracking the progress. you can use the stock apc.php script from the distro and upload a large file; this will give you time to check in apc.php. -nathan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] APC - Upload progress problem. apc
On Tue, Sep 15, 2009 at 12:05 AM, Phred White phpl...@planetphred.comwrote: Folks: Thanks for all your help and suggestions. Miracle of miracles I am now getting a response,so I can start some level of debugging. I am not sure exactly what has been going on. I NEVER got a response, then I did - when I tried uploading some different files. It seems that larger files always give a negative response for me. Now I am thinking that it has been a timing issue. My ajax stuff doesn't repeat yet, so there is currently only one request. It seems that if the file is a little too large, the first response is always false, that may be the case for very small files too. I finally just picked a file that was the right size. Since I could never verify that APC was responding, it didn't occur to me to go ahead and iron out the ajax stuff. Anyway now I can move forward. Thanks all for all your suggestions, sorry this ends up being such a stupid conclusion. good work pushing through it phred! it was a pain in the ass when i implemented it a few weeks back as well, so lets just assume thats how it is for everyone ;) -nathan
Re: [PHP] APC - Upload progress problem. apc
On Sep 13, 2009, at 8:50 PM, Eddie Drapkin wrote: On Sun, Sep 13, 2009 at 9:38 PM, Phred White phpl...@planetphred.com wrote: On Sep 13, 2009, at 7:34 PM, Eddie Drapkin wrote: On Sun, Sep 13, 2009 at 8:29 PM, Phred White phpl...@planetphred.com wrote: On Sep 11, 2009, at 1:17 PM, Eddie Drapkin wrote: On Fri, Sep 11, 2009 at 1:02 PM, Phred White phpl...@planetphred.com wrote: Hey folks.. Anybody ever use APC to show upload progress? It sounds really cool, but apc_fetch always returns false a value for uploads. I can apc_add something and fetch it, but not for uploads : ( (set-up: php-apc 3.0.19, Apache2, php 5.2.10, no suhosin patch) There is little info to google on this, and I've been through it. I was hoping some hard core, tireless, php programmer just knew the answer. With high anxiety, Phred I recently had to do roughly the same thing (visual upload progress) and I had done some research into APC. What I learned was that the upload tracking didn't work with FastCGI (which would have prevented our switch to nginx, but not a deal breaker) and what broke the deal, though, was the fact that APC's upload progress is apparently not thread safe, so if person A is uploading a file and person B starts an upload, you get a silent failure. Which brings me to another point, it seems to silently fail. Ultimately, I went with a flash based solution because the APC solution had way too many problems to be really useful. It's a nice thought, but I wouldn't recommend it. I know this isn't exactly what you wanted, but I had a similar experience and thought I would share :) Dang! You are exactly right - that isn't what I wanted to hear! : ( But better to know now, then when my timeline is already used up. Did you write your own flash based solution, or use an canned one? Thanks, Phred I actually wound up using swfupload because of a friend's recommendation and also because there's a nifty jQuery plugin for it. The project's main site: http://swfupload.org The jQuery plugin I'm using: http://blogs.bigfish.tv/adam/2009/06/14/swfupload-jquery-plugin/ The *only* issue I could find with a flash based uploader (I don't regard flash installation as an issue because we're a video based site and well, if you're using our site to watch videos...) was there's an as-of-yet unresolved bug in linux flash clients that locks a browser until upload is completed. Adobe's bug tracker seems to be down for me at the moment, but if you really want the bug, let me know offlist and I'll supply it later. :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Hey Eddie: One more question... I have an existing form that provides other data that need to be linked to the file upload. It looks like swfupload, just uploads all by its lonesome. I also need the javascript form validator to be triggered before any uploading occurs. Is this possible? You don't have to tell me how (though I wouldn't mind a few clues). I just want to know if it will meet my needs once i dig in. Thanks That should all be possible. I'd take a look at http://demo.swfupload.org/v220/featuresdemo/index.php as that has most of that happening on the page and you can bootleg some of their example code :) Bummer... It looked so promising, but on Macs, Flash has to load the entire file into memory to upload! R. So, it isn't viable for big files (Gig +) if you need it to be cross platform. So now I am looking at perl of all things! If you have any ideas let me know. thanks for all your help so far. Phred -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] APC - Upload progress problem. apc
On Mon, Sep 14, 2009 at 5:39 AM, Phred White phpl...@planetphred.com wrote: Bummer... It looked so promising, but on Macs, Flash has to load the entire file into memory to upload! R. So, it isn't viable for big files (Gig +) if you need it to be cross platform. So now I am looking at perl of all things! If you have any ideas let me know. thanks for all your help so far. Phred Honestly, uploading files that large over HTTP is probably a bad idea, as some very important protocol features to support those filesizes (resuming, pausing, etc.) are missing, even with a flash solution and I'd look into the viability of something like FTP instead. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] APC - Upload progress problem. apc
I am not sure why you ended up with Flash, but here there is a good old example with APC: http://webreflection.blogspot.com/2007/10/upload-progress-bar-with-php5-apc-and.html Regards CC: php-general@lists.php.net From: phpl...@planetphred.com To: oorza...@gmail.com Date: Mon, 14 Sep 2009 04:39:26 -0500 Subject: Re: [PHP] APC - Upload progress problem. apc Bummer... It looked so promising, but on Macs, Flash has to load the entire file into memory to upload! R. So, it isn't viable for big files (Gig +) if you need it to be cross platform. So now I am looking at perl of all things! If you have any ideas let me know. thanks for all your help so far. Phred -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Share your memories online with anyone you want. http://www.microsoft.com/middleeast/windows/windowslive/products/photos-share.aspx?tab=1
Re: [PHP] APC - Upload progress problem. apc
On 9/14/09 5:39 AM, Phred White phpl...@planetphred.com wrote: On Sep 13, 2009, at 8:50 PM, Eddie Drapkin wrote: On Sun, Sep 13, 2009 at 9:38 PM, Phred White phpl...@planetphred.com wrote: On Sep 13, 2009, at 7:34 PM, Eddie Drapkin wrote: On Sun, Sep 13, 2009 at 8:29 PM, Phred White phpl...@planetphred.com wrote: On Sep 11, 2009, at 1:17 PM, Eddie Drapkin wrote: On Fri, Sep 11, 2009 at 1:02 PM, Phred White phpl...@planetphred.com wrote: Hey folks.. Anybody ever use APC to show upload progress? It sounds really cool, but apc_fetch always returns false a value for uploads. I can apc_add something and fetch it, but not for uploads : ( (set-up: php-apc 3.0.19, Apache2, php 5.2.10, no suhosin patch) There is little info to google on this, and I've been through it. I was hoping some hard core, tireless, php programmer just knew the answer. With high anxiety, Phred I recently had to do roughly the same thing (visual upload progress) and I had done some research into APC. What I learned was that the upload tracking didn't work with FastCGI (which would have prevented our switch to nginx, but not a deal breaker) and what broke the deal, though, was the fact that APC's upload progress is apparently not thread safe, so if person A is uploading a file and person B starts an upload, you get a silent failure. Which brings me to another point, it seems to silently fail. Ultimately, I went with a flash based solution because the APC solution had way too many problems to be really useful. It's a nice thought, but I wouldn't recommend it. I know this isn't exactly what you wanted, but I had a similar experience and thought I would share :) Dang! You are exactly right - that isn't what I wanted to hear! : ( But better to know now, then when my timeline is already used up. Did you write your own flash based solution, or use an canned one? Thanks, Phred I actually wound up using swfupload because of a friend's recommendation and also because there's a nifty jQuery plugin for it. The project's main site: http://swfupload.org The jQuery plugin I'm using: http://blogs.bigfish.tv/adam/2009/06/14/swfupload-jquery-plugin/ The *only* issue I could find with a flash based uploader (I don't regard flash installation as an issue because we're a video based site and well, if you're using our site to watch videos...) was there's an as-of-yet unresolved bug in linux flash clients that locks a browser until upload is completed. Adobe's bug tracker seems to be down for me at the moment, but if you really want the bug, let me know offlist and I'll supply it later. :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Hey Eddie: One more question... I have an existing form that provides other data that need to be linked to the file upload. It looks like swfupload, just uploads all by its lonesome. I also need the javascript form validator to be triggered before any uploading occurs. Is this possible? You don't have to tell me how (though I wouldn't mind a few clues). I just want to know if it will meet my needs once i dig in. Thanks That should all be possible. I'd take a look at http://demo.swfupload.org/v220/featuresdemo/index.php as that has most of that happening on the page and you can bootleg some of their example code :) Bummer... It looked so promising, but on Macs, Flash has to load the entire file into memory to upload! R. So, it isn't viable for big files (Gig +) if you need it to be cross platform. So now I am looking at perl of all things! If you have any ideas let me know. thanks for all your help so far. with files that big, perhaps could write client js that polls a script on the server that simply returns the file size(s)? if you want a thermometer, use the number to resize a colored div. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] APC - Upload progress problem. apc
Hey Andrea: Ahhh yes, I've come full circle. I STARTED with php-apc. I really wanted an all-PHP solution, but apc_fetch() ALWAYS returns false a value for uploads. I can apc_add() something and apc_fetch it... but not for uploads : ( The apc.php summary page they supply that sows all the caching stats, shows upload is enabled, but no other info about upload. It seems like the upload is never being communicated to APC. (my set-up: php-apc 3.0.19, Apache2, php 5.2.10, no suhosin patch, no FastCGI) If I can get APC to do its basic thing, then I have the rest figured out (though I am going to look at your solution in more detail, thx). Unfortunately, I just don't know how to debug APC. No errors are generated - the problem is totally opaque to me. I looked at your link, and it looks great, perhaps you have some insight into my narrow APC problem. One other thing, Eddie was talking about APC not being thread-safe. I have heard this before, but also heard it refuted. Do you have any insight on this? I am going insane, so any help you can toss my way would be most merciful. Thanks, Phred On Sep 14, 2009, at 8:45 AM, Andrea Giammarchi wrote: I am not sure why you ended up with Flash, but here there is a good old example with APC: http://webreflection.blogspot.com/2007/10/upload-progress-bar-with-php5-apc-and.html Regards CC: php-general@lists.php.net From: phpl...@planetphred.com To: oorza...@gmail.com Date: Mon, 14 Sep 2009 04:39:26 -0500 Subject: Re: [PHP] APC - Upload progress problem. apc Bummer... It looked so promising, but on Macs, Flash has to load the entire file into memory to upload! R. So, it isn't viable for big files (Gig +) if you need it to be cross platform. So now I am looking at perl of all things! If you have any ideas let me know. thanks for all your help so far. Phred -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Share your memories online with anyone you want. http://www.microsoft.com/middleeast/windows/windowslive/products/photos-share.aspx?tab=1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] APC - Upload progress problem. apc
truly old alternative: http://www.devpro.it/upload_progress/ CC: php-general@lists.php.net From: phpl...@planetphred.com To: an_...@hotmail.com Subject: Re: [PHP] APC - Upload progress problem. apc Date: Mon, 14 Sep 2009 10:54:21 -0500 Hey Andrea: Ahhh yes, I've come full circle. I STARTED with php-apc. I really wanted an all-PHP solution, but apc_fetch() ALWAYS returns false a value for uploads. I can apc_add() something and apc_fetch it... but not for uploads : ( The apc.php summary page they supply that sows all the caching stats, shows upload is enabled, but no other info about upload. It seems like the upload is never being communicated to APC. (my set-up: php-apc 3.0.19, Apache2, php 5.2.10, no suhosin patch, no FastCGI) If I can get APC to do its basic thing, then I have the rest figured out (though I am going to look at your solution in more detail, thx). Unfortunately, I just don't know how to debug APC. No errors are generated - the problem is totally opaque to me. I looked at your link, and it looks great, perhaps you have some insight into my narrow APC problem. One other thing, Eddie was talking about APC not being thread-safe. I have heard this before, but also heard it refuted. Do you have any insight on this? I am going insane, so any help you can toss my way would be most merciful. Thanks, Phred On Sep 14, 2009, at 8:45 AM, Andrea Giammarchi wrote: I am not sure why you ended up with Flash, but here there is a good old example with APC: http://webreflection.blogspot.com/2007/10/upload-progress-bar-with-php5-apc-and.html Regards CC: php-general@lists.php.net From: phpl...@planetphred.com To: oorza...@gmail.com Date: Mon, 14 Sep 2009 04:39:26 -0500 Subject: Re: [PHP] APC - Upload progress problem. apc Bummer... It looked so promising, but on Macs, Flash has to load the entire file into memory to upload! R. So, it isn't viable for big files (Gig +) if you need it to be cross platform. So now I am looking at perl of all things! If you have any ideas let me know. thanks for all your help so far. Phred -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Share your memories online with anyone you want. http://www.microsoft.com/middleeast/windows/windowslive/products/photos-share.aspx?tab=1 _ Share your memories online with anyone you want. http://www.microsoft.com/middleeast/windows/windowslive/products/photos-share.aspx?tab=1
Re: [PHP] APC - Upload progress problem. apc
On Sep 14, 2009, at 9:15 AM, Tom Worster wrote: with files that big, perhaps could write client js that polls a script on the server that simply returns the file size(s)? if you want a thermometer, use the number to resize a colored div. Thanks Tom, for weighing in. Having js poll a script on the server is kind of what APC was about, and perl as well. Are you saying I could use PHP on the server side to do this? It seems almost obvious, but no one mentions it any where on the web, so a expected there was some fundamental limitation without APC. Do you have any idea what this script might look like? Is it possible to get the temp file name before the upload is completed so that its size can be monitored? If it is, it is just too dang simple! ...but I'd take it for sure. Thanks, Phred -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] APC - Upload progress problem. apc
The concept of my last link is this: the instant before you do the upload you ask PHP to scan the tmp folder, or the folder used to upload files (often the tmp) and you snap number of files, then the upload starts, and it will create a temp file with a PHP predefined prefix, you array_diff the snap with the current file list and you get the file that the user is uploading. At that point if you are lucky the input=file field will give you access to its fileSize, and you have everything to create a progress bar: the polled incremental tmp file size in the server, plus the total in the client, a bit of transitions/effects and that's it. This method is not ideal, generally speaking, because it could easily suffer concurrency between multiple users. I did not know Flash player had to put the entire file in memory, it sounds truly silly for scalability reasons, are you absolutely sure about this? About APC you need to enable it and so far I had no problems with files up to 350 Mb , I wonder why 1Gb should be a problem. Regards CC: php-general@lists.php.net From: phpl...@planetphred.com To: f...@thefsb.org Date: Mon, 14 Sep 2009 13:16:13 -0500 Subject: Re: [PHP] APC - Upload progress problem. apc On Sep 14, 2009, at 9:15 AM, Tom Worster wrote: with files that big, perhaps could write client js that polls a script on the server that simply returns the file size(s)? if you want a thermometer, use the number to resize a colored div. Thanks Tom, for weighing in. Having js poll a script on the server is kind of what APC was about, and perl as well. Are you saying I could use PHP on the server side to do this? It seems almost obvious, but no one mentions it any where on the web, so a expected there was some fundamental limitation without APC. Do you have any idea what this script might look like? Is it possible to get the temp file name before the upload is completed so that its size can be monitored? If it is, it is just too dang simple! ...but I'd take it for sure. Thanks, Phred -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ More than messages–check out the rest of the Windows Live™. http://www.microsoft.com/windows/windowslive/
Re: [PHP] APC - Upload progress problem. apc
Andrea: I see. That is a cool idea, but you are right, concurrency could definitely be a problem. That's what APC is supposed to solve because it tags the file with a unique ID. But I can't get that sucker to return the value to me! If I could get APC to work I would be done. I also started looking at trying to grab the temp file, . $_FILES['video_file']['tmp_name'], and then keep checking its size on the server, but I don't think I can get the temp name from php until it is uploaded. Do you know if that is possible? One other thing, I looked at a canned media management web app ($875 US) that will do this uploading, and it doesn't require APC, so there definitely is some way to do this with basic PHP. Thanks, Phred On Sep 14, 2009, at 1:55 PM, Andrea Giammarchi wrote: The concept of my last link is this: the instant before you do the upload you ask PHP to scan the tmp folder, or the folder used to upload files (often the tmp) and you snap number of files, then the upload starts, and it will create a temp file with a PHP predefined prefix, you array_diff the snap with the current file list and you get the file that the user is uploading. At that point if you are lucky the input=file field will give you access to its fileSize, and you have everything to create a progress bar: the polled incremental tmp file size in the server, plus the total in the client, a bit of transitions/effects and that's it. This method is not ideal, generally speaking, because it could easily suffer concurrency between multiple users. I did not know Flash player had to put the entire file in memory, it sounds truly silly for scalability reasons, are you absolutely sure about this? About APC you need to enable it and so far I had no problems with files up to 350 Mb , I wonder why 1Gb should be a problem. Regards CC: php-general@lists.php.net From: phpl...@planetphred.com To: f...@thefsb.org Date: Mon, 14 Sep 2009 13:16:13 -0500 Subject: Re: [PHP] APC - Upload progress problem. apc On Sep 14, 2009, at 9:15 AM, Tom Worster wrote: with files that big, perhaps could write client js that polls a script on the server that simply returns the file size(s)? if you want a thermometer, use the number to resize a colored div. Thanks Tom, for weighing in. Having js poll a script on the server is kind of what APC was about, and perl as well. Are you saying I could use PHP on the server side to do this? It seems almost obvious, but no one mentions it any where on the web, so a expected there was some fundamental limitation without APC. Do you have any idea what this script might look like? Is it possible to get the temp file name before the upload is completed so that its size can be monitored? If it is, it is just too dang simple! ...but I'd take it for sure. Thanks, Phred -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ More than messages–check out the rest of the Windows Live™. http://www.microsoft.com/windows/windowslive/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] APC - Upload progress problem. apc
On Mon, Sep 14, 2009 at 2:21 PM, Phred White phpl...@planetphred.comwrote: Andrea: I see. That is a cool idea, but you are right, concurrency could definitely be a problem. That's what APC is supposed to solve because it tags the file with a unique ID. But I can't get that sucker to return the value to me! If I could get APC to work I would be done. I also started looking at trying to grab the temp file, .$_FILES['video_file']['tmp_name'], and then keep checking its size on the server, but I don't think I can get the temp name from php until it is uploaded. Do you know if that is possible? One other thing, I looked at a canned media management web app ($875 US) that will do this uploading, and it doesn't require APC, so there definitely is some way to do this with basic PHP. Pread, just hopping in the thread again, so excuse me if this has been covered, but have you gone over you environment settings thoroughly? one of the key values for the upload feature to work is, apc.rfc1867 which needs to be set to 1 or On. also, the php version needs to be at least = 5.2. not sure on the concurrency issues, but thats something that could easily be verified w/ a test once youve got it running. -nathan
RE: [PHP] APC - Upload progress problem. apc
Can you write here how you configured APC? In my old test I had to set apc.rfc1867 = On and if you grab the zip: http://www.3site.eu/examples/APCQuery.zip tell me what is exactly wrong (I tried ages ago though, I am using other strategies right now: http://code.google.com/p/noswfupload/ - not suitable for 1Gb of files though) About trying to grab info via PHP ... there is a little problem, that page will be executed only after the file has been sent, so obviously you'll never be able to know size, error, tmp_name, before the file has benn fully stored in the tmp or specific folder, got the problem? Regards CC: f...@thefsb.org; php-general@lists.php.net From: phpl...@planetphred.com To: an_...@hotmail.com Subject: Re: [PHP] APC - Upload progress problem. apc Date: Mon, 14 Sep 2009 15:21:40 -0500 Andrea: I see. That is a cool idea, but you are right, concurrency could definitely be a problem. That's what APC is supposed to solve because it tags the file with a unique ID. But I can't get that sucker to return the value to me! If I could get APC to work I would be done. I also started looking at trying to grab the temp file, . $_FILES['video_file']['tmp_name'], and then keep checking its size on the server, but I don't think I can get the temp name from php until it is uploaded. Do you know if that is possible? One other thing, I looked at a canned media management web app ($875 US) that will do this uploading, and it doesn't require APC, so there definitely is some way to do this with basic PHP. Thanks, Phred On Sep 14, 2009, at 1:55 PM, Andrea Giammarchi wrote: The concept of my last link is this: the instant before you do the upload you ask PHP to scan the tmp folder, or the folder used to upload files (often the tmp) and you snap number of files, then the upload starts, and it will create a temp file with a PHP predefined prefix, you array_diff the snap with the current file list and you get the file that the user is uploading. At that point if you are lucky the input=file field will give you access to its fileSize, and you have everything to create a progress bar: the polled incremental tmp file size in the server, plus the total in the client, a bit of transitions/effects and that's it. This method is not ideal, generally speaking, because it could easily suffer concurrency between multiple users. I did not know Flash player had to put the entire file in memory, it sounds truly silly for scalability reasons, are you absolutely sure about this? About APC you need to enable it and so far I had no problems with files up to 350 Mb , I wonder why 1Gb should be a problem. Regards CC: php-general@lists.php.net From: phpl...@planetphred.com To: f...@thefsb.org Date: Mon, 14 Sep 2009 13:16:13 -0500 Subject: Re: [PHP] APC - Upload progress problem. apc On Sep 14, 2009, at 9:15 AM, Tom Worster wrote: with files that big, perhaps could write client js that polls a script on the server that simply returns the file size(s)? if you want a thermometer, use the number to resize a colored div. Thanks Tom, for weighing in. Having js poll a script on the server is kind of what APC was about, and perl as well. Are you saying I could use PHP on the server side to do this? It seems almost obvious, but no one mentions it any where on the web, so a expected there was some fundamental limitation without APC. Do you have any idea what this script might look like? Is it possible to get the temp file name before the upload is completed so that its size can be monitored? If it is, it is just too dang simple! ...but I'd take it for sure. Thanks, Phred -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ More than messages–check out the rest of the Windows Live™. http://www.microsoft.com/windows/windowslive/ _ More than messages–check out the rest of the Windows Live™. http://www.microsoft.com/windows/windowslive/
Re: [PHP] APC - Upload progress problem. apc
On Sep 14, 2009, at 3:30 PM, Nathan Nobbe wrote: On Mon, Sep 14, 2009 at 2:21 PM, Phred White phpl...@planetphred.com wrote: Andrea: I see. That is a cool idea, but you are right, concurrency could definitely be a problem. That's what APC is supposed to solve because it tags the file with a unique ID. But I can't get that sucker to return the value to me! If I could get APC to work I would be done. I also started looking at trying to grab the temp file, . $_FILES['video_file']['tmp_name'], and then keep checking its size on the server, but I don't think I can get the temp name from php until it is uploaded. Do you know if that is possible? One other thing, I looked at a canned media management web app ($875 US) that will do this uploading, and it doesn't require APC, so there definitely is some way to do this with basic PHP. Pread, just hopping in the thread again, so excuse me if this has been covered, but have you gone over you environment settings thoroughly? one of the key values for the upload feature to work is, apc.rfc1867 which needs to be set to 1 or On. also, the php version needs to be at least = 5.2. not sure on the concurrency issues, but thats something that could easily be verified w/ a test once youve got it running. -nathan thanks for jumpin in Nathan. The water's fine! (Except for the sharks : ) I have in my php.ini: apc.rfc1867 = On apc.rfc1867_freq = 10K The latter is because i read somewhere that some OS configs don't like the default of 0. APC has a file, apc.php, that sows all the stats for apc, and it says file upload is on and it is caching files quite nicely, though I don't care too much about that right now. my set-up: php-apc 3.0.19, Apache2, php 5.2.10, no suhosin patch, no FastCGI - the latter two items i have heard cause problems with APC also, so they are not part of my config. Phred
Re: [PHP] APC - Upload progress problem. apc
Andrea: I have in my php.ini: apc.rfc1867 = On apc.rfc1867_freq = 10K The apc.php diagnostic/report page says it is on. It just returns false. I will look at your zip file and see if something jumps out. Thanks, Phred On Sep 14, 2009, at 4:04 PM, Andrea Giammarchi wrote: Can you write here how you configured APC? In my old test I had to set apc.rfc1867 = On and if you grab the zip: http://www.3site.eu/examples/APCQuery.zip tell me what is exactly wrong (I tried ages ago though, I am using other strategies right now:http://code.google.com/p/noswfupload/ - not suitable for 1Gb of files though) About trying to grab info via PHP ... there is a little problem, that page will be executed only after the file has been sent, so obviously you'll never be able to know size, error, tmp_name, before the file has benn fully stored in the tmp or specific folder, got the problem? Regards CC: f...@thefsb.org; php-general@lists.php.net From: phpl...@planetphred.com To: an_...@hotmail.com Subject: Re: [PHP] APC - Upload progress problem. apc Date: Mon, 14 Sep 2009 15:21:40 -0500 Andrea: I see. That is a cool idea, but you are right, concurrency could definitely be a problem. That's what APC is supposed to solve because it tags the file with a unique ID. But I can't get that sucker to return the value to me! If I could get APC to work I would be done. I also started looking at trying to grab the temp file, . $_FILES['video_file']['tmp_name'], and then keep checking its size on the server, but I don't think I can get the temp name from php until it is uploaded. Do you know if that is possible? One other thing, I looked at a canned media management web app ($875 US) that will do this uploading, and it doesn't require APC, so there definitely is some way to do this with basic PHP. Thanks, Phred On Sep 14, 2009, at 1:55 PM, Andrea Giammarchi wrote: The concept of my last link is this: the instant before you do the upload you ask PHP to scan the tmp folder, or the folder used to upload files (often the tmp) and you snap number of files, then the upload starts, and it will create a temp file with a PHP predefined prefix, you array_diff the snap with the current file list and you get the file that the user is uploading. At that point if you are lucky the input=file field will give you access to its fileSize, and you have everything to create a progress bar: the polled incremental tmp file size in the server, plus the total in the client, a bit of transitions/effects and that's it. This method is not ideal, generally speaking, because it could easily suffer concurrency between multiple users. I did not know Flash player had to put the entire file in memory, it sounds truly silly for scalability reasons, are you absolutely sure about this? About APC you need to enable it and so far I had no problems with files up to 350 Mb , I wonder why 1Gb should be a problem. Regards CC: php-general@lists.php.net From: phpl...@planetphred.com To: f...@thefsb.org Date: Mon, 14 Sep 2009 13:16:13 -0500 Subject: Re: [PHP] APC - Upload progress problem. apc On Sep 14, 2009, at 9:15 AM, Tom Worster wrote: with files that big, perhaps could write client js that polls a script on the server that simply returns the file size(s)? if you want a thermometer, use the number to resize a colored div. Thanks Tom, for weighing in. Having js poll a script on the server is kind of what APC was about, and perl as well. Are you saying I could use PHP on the server side to do this? It seems almost obvious, but no one mentions it any where on the web, so a expected there was some fundamental limitation without APC. Do you have any idea what this script might look like? Is it possible to get the temp file name before the upload is completed so that its size can be monitored? If it is, it is just too dang simple! ...but I'd take it for sure. Thanks, Phred -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ More than messages–check out the rest of the Windows Live™. http://www.microsoft.com/windows/windowslive/ check out the rest of the Windows Live™. More than mail–Windows Live™ goes way beyond your inbox. More than messages
Re: [PHP] APC - Upload progress problem. apc
On Mon, Sep 14, 2009 at 4:50 PM, Phred White phpl...@planetphred.comwrote: Andrea: I have in my php.ini: apc.rfc1867 = On apc.rfc1867_freq = 10K The apc.php diagnostic/report page says it is on. It just returns false. I will look at your zip file and see if something jumps out. what about your other apc.rfc1867 settings? are you posting the correct field to the server to tell apc to start tracking, and also are you grabbing the correct value when trying to determine the status in your progress tracking script? by default, your form needs an input like, input type=hidden name=APC_UPLOAD_PROGRESS id=progress_key value=?php echo $id?/ then in the progress checking script you will need something like, ?php if(isset($_GET['progress_key'])) { $status = apc_fetch('upload_'.$_GET['progress_key']); echo $status['current']/$status['total']*100; } ? the names of these variables depend upon apc.rfc1867_name and apc.rfc1867_prefix respectively. take a look at this article, it was really helpful, http://www.ibm.com/developerworks/opensource/library/os-php-v525/ also, to get going fast, dont bother w/ the progress script yet. just focus on getting apc to start tracking the progress. you can use the stock apc.php script from the distro and upload a large file; this will give you time to check in apc.php. -nathan
Re: [PHP] APC - Upload progress problem. apc
On Sep 11, 2009, at 1:17 PM, Eddie Drapkin wrote: On Fri, Sep 11, 2009 at 1:02 PM, Phred White phpl...@planetphred.com wrote: Hey folks.. Anybody ever use APC to show upload progress? It sounds really cool, but apc_fetch always returns false a value for uploads. I can apc_add something and fetch it, but not for uploads : ( (set-up: php-apc 3.0.19, Apache2, php 5.2.10, no suhosin patch) There is little info to google on this, and I've been through it. I was hoping some hard core, tireless, php programmer just knew the answer. With high anxiety, Phred I recently had to do roughly the same thing (visual upload progress) and I had done some research into APC. What I learned was that the upload tracking didn't work with FastCGI (which would have prevented our switch to nginx, but not a deal breaker) and what broke the deal, though, was the fact that APC's upload progress is apparently not thread safe, so if person A is uploading a file and person B starts an upload, you get a silent failure. Which brings me to another point, it seems to silently fail. Ultimately, I went with a flash based solution because the APC solution had way too many problems to be really useful. It's a nice thought, but I wouldn't recommend it. I know this isn't exactly what you wanted, but I had a similar experience and thought I would share :) Dang! You are exactly right - that isn't what I wanted to hear! : ( But better to know now, then when my timeline is already used up. Did you write your own flash based solution, or use an canned one? Thanks, Phred -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] APC - Upload progress problem. apc
On Sep 11, 2009, at 4:01 PM, tedd wrote: At 2:17 PM -0400 9/11/09, Eddie Drapkin wrote: On Fri, Sep 11, 2009 at 1:02 PM, Phred White phpl...@planetphred.com wrote: Hey folks.. Anybody ever use APC to show upload progress? Nope, I choose not to complicate my life. :-) Instead, I give the user one of these: http://webbytedd.com/bb/wait/ Besides, what does the user have to know anyway that makes it so important that they see a progress bar? Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com those are SWEET! That page is going to become one of my favorite pages just to look at for therapeutic purposes : ) Unfortunately, my folks will be uploading a gig at a crack, so the really need to know what is actually going on! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] APC - Upload progress problem. apc
On Sun, Sep 13, 2009 at 8:29 PM, Phred White phpl...@planetphred.com wrote: On Sep 11, 2009, at 1:17 PM, Eddie Drapkin wrote: On Fri, Sep 11, 2009 at 1:02 PM, Phred White phpl...@planetphred.com wrote: Hey folks.. Anybody ever use APC to show upload progress? It sounds really cool, but apc_fetch always returns false a value for uploads. I can apc_add something and fetch it, but not for uploads : ( (set-up: php-apc 3.0.19, Apache2, php 5.2.10, no suhosin patch) There is little info to google on this, and I've been through it. I was hoping some hard core, tireless, php programmer just knew the answer. With high anxiety, Phred I recently had to do roughly the same thing (visual upload progress) and I had done some research into APC. What I learned was that the upload tracking didn't work with FastCGI (which would have prevented our switch to nginx, but not a deal breaker) and what broke the deal, though, was the fact that APC's upload progress is apparently not thread safe, so if person A is uploading a file and person B starts an upload, you get a silent failure. Which brings me to another point, it seems to silently fail. Ultimately, I went with a flash based solution because the APC solution had way too many problems to be really useful. It's a nice thought, but I wouldn't recommend it. I know this isn't exactly what you wanted, but I had a similar experience and thought I would share :) Dang! You are exactly right - that isn't what I wanted to hear! : ( But better to know now, then when my timeline is already used up. Did you write your own flash based solution, or use an canned one? Thanks, Phred I actually wound up using swfupload because of a friend's recommendation and also because there's a nifty jQuery plugin for it. The project's main site: http://swfupload.org The jQuery plugin I'm using: http://blogs.bigfish.tv/adam/2009/06/14/swfupload-jquery-plugin/ The *only* issue I could find with a flash based uploader (I don't regard flash installation as an issue because we're a video based site and well, if you're using our site to watch videos...) was there's an as-of-yet unresolved bug in linux flash clients that locks a browser until upload is completed. Adobe's bug tracker seems to be down for me at the moment, but if you really want the bug, let me know offlist and I'll supply it later. :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] APC - Upload progress problem. apc
On Sep 13, 2009, at 7:34 PM, Eddie Drapkin wrote: On Sun, Sep 13, 2009 at 8:29 PM, Phred White phpl...@planetphred.com wrote: On Sep 11, 2009, at 1:17 PM, Eddie Drapkin wrote: On Fri, Sep 11, 2009 at 1:02 PM, Phred White phpl...@planetphred.com wrote: Hey folks.. Anybody ever use APC to show upload progress? It sounds really cool, but apc_fetch always returns false a value for uploads. I can apc_add something and fetch it, but not for uploads : ( (set-up: php-apc 3.0.19, Apache2, php 5.2.10, no suhosin patch) There is little info to google on this, and I've been through it. I was hoping some hard core, tireless, php programmer just knew the answer. With high anxiety, Phred I recently had to do roughly the same thing (visual upload progress) and I had done some research into APC. What I learned was that the upload tracking didn't work with FastCGI (which would have prevented our switch to nginx, but not a deal breaker) and what broke the deal, though, was the fact that APC's upload progress is apparently not thread safe, so if person A is uploading a file and person B starts an upload, you get a silent failure. Which brings me to another point, it seems to silently fail. Ultimately, I went with a flash based solution because the APC solution had way too many problems to be really useful. It's a nice thought, but I wouldn't recommend it. I know this isn't exactly what you wanted, but I had a similar experience and thought I would share :) Dang! You are exactly right - that isn't what I wanted to hear! : ( But better to know now, then when my timeline is already used up. Did you write your own flash based solution, or use an canned one? Thanks, Phred I actually wound up using swfupload because of a friend's recommendation and also because there's a nifty jQuery plugin for it. The project's main site: http://swfupload.org The jQuery plugin I'm using: http://blogs.bigfish.tv/adam/2009/06/14/swfupload-jquery-plugin/ The *only* issue I could find with a flash based uploader (I don't regard flash installation as an issue because we're a video based site and well, if you're using our site to watch videos...) was there's an as-of-yet unresolved bug in linux flash clients that locks a browser until upload is completed. Adobe's bug tracker seems to be down for me at the moment, but if you really want the bug, let me know offlist and I'll supply it later. :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Thanks Eddie. I will look into it. I agree, if you don't have Flash use your telegraph or something. Sheesh! (iPhone users excepted - they morn their lack of Flash) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] APC - Upload progress problem. apc
On Sep 13, 2009, at 7:34 PM, Eddie Drapkin wrote: On Sun, Sep 13, 2009 at 8:29 PM, Phred White phpl...@planetphred.com wrote: On Sep 11, 2009, at 1:17 PM, Eddie Drapkin wrote: On Fri, Sep 11, 2009 at 1:02 PM, Phred White phpl...@planetphred.com wrote: Hey folks.. Anybody ever use APC to show upload progress? It sounds really cool, but apc_fetch always returns false a value for uploads. I can apc_add something and fetch it, but not for uploads : ( (set-up: php-apc 3.0.19, Apache2, php 5.2.10, no suhosin patch) There is little info to google on this, and I've been through it. I was hoping some hard core, tireless, php programmer just knew the answer. With high anxiety, Phred I recently had to do roughly the same thing (visual upload progress) and I had done some research into APC. What I learned was that the upload tracking didn't work with FastCGI (which would have prevented our switch to nginx, but not a deal breaker) and what broke the deal, though, was the fact that APC's upload progress is apparently not thread safe, so if person A is uploading a file and person B starts an upload, you get a silent failure. Which brings me to another point, it seems to silently fail. Ultimately, I went with a flash based solution because the APC solution had way too many problems to be really useful. It's a nice thought, but I wouldn't recommend it. I know this isn't exactly what you wanted, but I had a similar experience and thought I would share :) Dang! You are exactly right - that isn't what I wanted to hear! : ( But better to know now, then when my timeline is already used up. Did you write your own flash based solution, or use an canned one? Thanks, Phred I actually wound up using swfupload because of a friend's recommendation and also because there's a nifty jQuery plugin for it. The project's main site: http://swfupload.org The jQuery plugin I'm using: http://blogs.bigfish.tv/adam/2009/06/14/swfupload-jquery-plugin/ The *only* issue I could find with a flash based uploader (I don't regard flash installation as an issue because we're a video based site and well, if you're using our site to watch videos...) was there's an as-of-yet unresolved bug in linux flash clients that locks a browser until upload is completed. Adobe's bug tracker seems to be down for me at the moment, but if you really want the bug, let me know offlist and I'll supply it later. :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Hey Eddie: One more question... I have an existing form that provides other data that need to be linked to the file upload. It looks like swfupload, just uploads all by its lonesome. I also need the javascript form validator to be triggered before any uploading occurs. Is this possible? You don't have to tell me how (though I wouldn't mind a few clues). I just want to know if it will meet my needs once i dig in. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] APC - Upload progress problem. apc
On Sun, Sep 13, 2009 at 9:38 PM, Phred White phpl...@planetphred.com wrote: On Sep 13, 2009, at 7:34 PM, Eddie Drapkin wrote: On Sun, Sep 13, 2009 at 8:29 PM, Phred White phpl...@planetphred.com wrote: On Sep 11, 2009, at 1:17 PM, Eddie Drapkin wrote: On Fri, Sep 11, 2009 at 1:02 PM, Phred White phpl...@planetphred.com wrote: Hey folks.. Anybody ever use APC to show upload progress? It sounds really cool, but apc_fetch always returns false a value for uploads. I can apc_add something and fetch it, but not for uploads : ( (set-up: php-apc 3.0.19, Apache2, php 5.2.10, no suhosin patch) There is little info to google on this, and I've been through it. I was hoping some hard core, tireless, php programmer just knew the answer. With high anxiety, Phred I recently had to do roughly the same thing (visual upload progress) and I had done some research into APC. What I learned was that the upload tracking didn't work with FastCGI (which would have prevented our switch to nginx, but not a deal breaker) and what broke the deal, though, was the fact that APC's upload progress is apparently not thread safe, so if person A is uploading a file and person B starts an upload, you get a silent failure. Which brings me to another point, it seems to silently fail. Ultimately, I went with a flash based solution because the APC solution had way too many problems to be really useful. It's a nice thought, but I wouldn't recommend it. I know this isn't exactly what you wanted, but I had a similar experience and thought I would share :) Dang! You are exactly right - that isn't what I wanted to hear! : ( But better to know now, then when my timeline is already used up. Did you write your own flash based solution, or use an canned one? Thanks, Phred I actually wound up using swfupload because of a friend's recommendation and also because there's a nifty jQuery plugin for it. The project's main site: http://swfupload.org The jQuery plugin I'm using: http://blogs.bigfish.tv/adam/2009/06/14/swfupload-jquery-plugin/ The *only* issue I could find with a flash based uploader (I don't regard flash installation as an issue because we're a video based site and well, if you're using our site to watch videos...) was there's an as-of-yet unresolved bug in linux flash clients that locks a browser until upload is completed. Adobe's bug tracker seems to be down for me at the moment, but if you really want the bug, let me know offlist and I'll supply it later. :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Hey Eddie: One more question... I have an existing form that provides other data that need to be linked to the file upload. It looks like swfupload, just uploads all by its lonesome. I also need the javascript form validator to be triggered before any uploading occurs. Is this possible? You don't have to tell me how (though I wouldn't mind a few clues). I just want to know if it will meet my needs once i dig in. Thanks That should all be possible. I'd take a look at http://demo.swfupload.org/v220/featuresdemo/index.php as that has most of that happening on the page and you can bootleg some of their example code :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] APC - Upload progress problem. apc
On Fri, Sep 11, 2009 at 1:02 PM, Phred White phpl...@planetphred.com wrote: Hey folks.. Anybody ever use APC to show upload progress? It sounds really cool, but apc_fetch always returns false a value for uploads. I can apc_add something and fetch it, but not for uploads : ( (set-up: php-apc 3.0.19, Apache2, php 5.2.10, no suhosin patch) There is little info to google on this, and I've been through it. I was hoping some hard core, tireless, php programmer just knew the answer. With high anxiety, Phred I recently had to do roughly the same thing (visual upload progress) and I had done some research into APC. What I learned was that the upload tracking didn't work with FastCGI (which would have prevented our switch to nginx, but not a deal breaker) and what broke the deal, though, was the fact that APC's upload progress is apparently not thread safe, so if person A is uploading a file and person B starts an upload, you get a silent failure. Which brings me to another point, it seems to silently fail. Ultimately, I went with a flash based solution because the APC solution had way too many problems to be really useful. It's a nice thought, but I wouldn't recommend it. I know this isn't exactly what you wanted, but I had a similar experience and thought I would share :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] APC - Upload progress problem. apc
At 2:17 PM -0400 9/11/09, Eddie Drapkin wrote: On Fri, Sep 11, 2009 at 1:02 PM, Phred White phpl...@planetphred.com wrote: Hey folks.. Anybody ever use APC to show upload progress? Nope, I choose not to complicate my life. :-) Instead, I give the user one of these: http://webbytedd.com/bb/wait/ Besides, what does the user have to know anyway that makes it so important that they see a progress bar? Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] APC - Upload progress problem. apc
On Fri, Sep 11, 2009 at 3:01 PM, tedd tedd.sperl...@gmail.com wrote: At 2:17 PM -0400 9/11/09, Eddie Drapkin wrote: On Fri, Sep 11, 2009 at 1:02 PM, Phred White phpl...@planetphred.com wrote: Hey folks.. Anybody ever use APC to show upload progress? Nope, I choose not to complicate my life. :-) Instead, I give the user one of these: http://webbytedd.com/bb/wait/ Besides, what does the user have to know anyway that makes it so important that they see a progress bar? on things that take longer than a few seconds, the generic spinners are pretty annoying, b/c youve no idea how much longer youve got to wait. plus progress bars look more professional, imo. anyways, tho, yeah, spinners are better for most cases i would say. -nathan