Uploads with progress-meter in PHP - a pain in the ass!
Okay, i probably guess that probably have some experience with it, probably already made an implementation that works. And probably you only think it works. But often not for production level or enterprise! At the end of the article you will praise once again APC - the PHP Opcode Cache
Well, I tried it all, the PECL uploadprogress_meter-extension which doesn’t really always compile to the latest PHP, upload with Flash ≥8 and JavaScript (because we want to show the progress in HTML). Then we or i have also additional requirements to the upload, like posting variables with one file. And it should really run stable what most solutions don’t!
Let’s summarize - Progress Meter using PHP as primary server language:
- PECL Extionsion uploadprogress_meter
- Often only compiles and runs stable to the version it was built for
- Wrappers with Perl
- Megaupload, Filechucker or how they call them, have some problems in stability, resulting not always in writing the monitor file. Who knows why? I made an own version based on Megaupload (which should be on release here shortly)
- Other PHP hacks
- Do they really run stable with the current PHP built?! Who will update them?
- Flash-Uploader with JavaScript Backends
- While beeing client side they have the generic problem of often calling a JavaScript-Callback that results in a flash-side timeout alert-box when you’re using broadband connections >1MB/s upstream. Shitty for all the customers on your commercial website with such a connection and without any technical knowledge.
- Pure Flash-based upload progress
- A solution that really works and runs stable, but do you wanna make your whole site in Flash or are you working in Flex?
- APC - the PHP opcode cache
- You heard right! Just add an
apc.rfc1867 = onto your PHP ini and submit also aAPC_UPLOAD_PROGRESS>-field and your on the right side calling the progress like withapc_fetch('upload_'.$_POST['APC_UPLOAD_PROGRESS']);For more just have a look here and enjoy
My Perl-based solution mentioned above (called jjUpload) will be available here shortly – didn’t i already post about it? It won’t work on it anymore since APC now has that functionality. Just bad for all you ZendCore- or ZendDebugger-Whores
Anyway, i’d like to hear what you prefer - client side progress-meters -or- if the status should be pulled from the server?