sangoku Posted March 27, 2010 Share Posted March 27, 2010 Hy again guys, i am still on a blank paper for my attachment system, I have a forum in which pictures and files as rar, zip, swf and such junk. What i want to achieve is that all files which are uploaded should not be uploaded again and again and again.... So far i have acme up with a md 5 value of the files as comparative parameter, also i could also compare the type of the file. I am also thinking to explode the name and exclude the usual signs like numbers and such stuff, only leave names and store them in a varchar row and put a fulltext index on it for search. But the thing is i need a way to pick out duplicate pictures to. I tooth of a good way i will just divide the value of the width with the value of height and the value then can represent the unique identifier with the exploded name and the md5 value of the file. As for the compressed files i am intending to keep them extracted and store the compression copy. Is there a way to access the rar and zip files directly without extracting them? The point is for every attachment to generate such data and then on every upload to do a full text body search is pretty slow i think as such i am thinking, Is there a way to convert those data onto a unique identifier which can be searched fast, something like a int value..... anyone has any ideas how to do it???????? Quote Link to comment https://forums.phpfreaks.com/topic/196717-how-to-keep-files-unique/ Share on other sites More sharing options...
siwelis Posted March 27, 2010 Share Posted March 27, 2010 Assuming you can determine whether it's a zip file or rar file... You extract get zip contents following this straight forward example. I'd like to say you can follow the example's 1 or 2 for reading RAR's here... However... It appears reading rar's may not be so easy. I don't think that this is a normal bundled feature with php packages and may have to be installed on the server manually. Installation instructions can be found here, though. Let me know if these RAR functions work out for ya. Hopefully I'm wrong about the non being bundled thing! Quote Link to comment https://forums.phpfreaks.com/topic/196717-how-to-keep-files-unique/#findComment-1032817 Share on other sites More sharing options...
sangoku Posted March 28, 2010 Author Share Posted March 28, 2010 Hmmmm just checked. Zip is installed and enabled on by default on wamp which should imply that is is installed on the server by default i found the function bool extractTo ( string $destination [, mixed $entries ] ) which duos the thing for me.. if i decide to do it that way... i am more concerned for the performance of the function.... I am wondering which is faster, extracting the data or reading it directly from the file... which is faster? Quote Link to comment https://forums.phpfreaks.com/topic/196717-how-to-keep-files-unique/#findComment-1033113 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.