I was looking to compress (preferebly using zip) files during upload. To reduce the amount of bandwidth used in the upload process, and save disk space on my server. I primarily code in PHP. I have tried searching, but have come to no solutions. Could anybody suggest anything?
Not as far as I’m aware.
You can request zip files as the upload format, but there’s not really much in the browser that has the capability to compress on-demand before uploading.
Through some searching, I saw an awful lot of posts regarding your question with answers like “well, you might be able to do it in flash…”, but I didn’t come across anyone who had actually done it.
You would need to create an application on the user’s computer to do the upload.
Just thinking - if you are PHP oriented then I can’t see compressing making a huge saving really - not these days when 1Mb is like 1Kb in the old days! Not to mention the decompression aspect!
My concern over bandwidth only really comes into play with large media files, like 10Mb and up. But then these file types in essence do not compress extra anyways, the compression being within the original format itself. Seems you are looking for a solution to a problem that hardly exists unless perhaps you are stuck on slow dial up - even then, with the light weight of most PHP files it seems a very small benefit to be obtained were you to establish a workable system!
Since PHP is server-side only, you wouldn’t be able to this anyway.
logic_earth probably points out the best approach.
You can compress files on your server after they’ve been uploaded. But to save BW as said you can either request (or even limit it to) zipped files, or get users to download a compression app if they don’t have one (maybe a RYO Java/ActiveX ?).
But there’s nothing that can do this on-the-fly to data being transported.
Flash or Java can definitely do it. But, the user will probably be getting security prompts, and those scare a lot of people.
Can you find examples?