Brady
A moan, a groan, my life story and how me, a technically minded person just can’t seem to fit in with anybody.

PHP File Upload Progress Bar

As you may be aware in php it doesn’t have the functionality to report back the status of file uploads. For example upload percent complete, speed of upload and estimated time of completion. To be able to provide a progress bar the easiest way would be to use a perl script to do the uploading for you as perl has this functionality. Now I build a file uploader for the public and I looked at providing a perl uploader but because I know very little about the language of perl I couldn’t get any examples to work for me, but the ones that did work needed some server side changes. These server side changes would be no good for most of my downloader’s as many of them don’t have root access to their server.

There is another solution out there but once again it involves making server side changes which hacks php and adds the additional functions to track the upload progress of a file.

The above hack for PHP can be found at http://pecl.php.net/package/uploadprogress. There isn’t much documentation out there for it but if you do a Google search you will find one or two examples.

The above hack I’m thinking about putting it in my module so that those that have the modified php will be able to run my uploader with the progress bar but those without would not get the upload progress bar. The thing in to build my module to use this hack I need a server that is running the hacked version of php. Thing is I’m stuck with a shared hosting account and I don’t have access to modify php. So if there is anyone out there that can lend me some space for a short time and is running the above hack please contact me so I can’t continue building my file uploader script

Ajax and JavaScript Exploiting

You may be aware of website-codes.com if not let me tell you. The idea of it was to provide php scripts that could run from any webhost that didn’t have php support. How I would achieve this would be through a line of JavaScript that user would put on their site. Well the website has been put on hold as I haven’t found time to code it.

Well anyway because I’ve been doing a lot of Ajax and JavaScript coding for where I work it had me thinking. If you could get Ajax to work on any webhost with only putting one line of code on their site? Well sure enough you can. I did a bit of testing there and then and it worked 100%. I couldn’t believe it. Because with JavaScript you can literally change the whole look and feel of a webpage, if you think hard enough you can see how this can be very dangerous to people’s websites. One thing that comes straight to mind is that you can use this one line of code to turn a whole page into a login page look-a-like (phishing) I now see why many public pages don’t allow JavaScript. E.G. MySpace.