Jump to content

Identify files without using filenames


sf_nick88

Recommended Posts

Hi,

I had a quick search but didn't really know what search terms to use and didn't have any luck - here or through Google. I was hoping someone might be able to help me out here. It would be very much appreciated.

I am creating an arcade script that allows users to run their own arcades - one of the features to make each arcade unique is to allow the admins to add new content. They can do this by uploading a particular flash game, video clip or whatever through the acp - however its highly likely that many arcades will want to upload the same content but I don't want to have to duplicate the files on my server.

I can't make everyone's content automatically available for everyone else either since that'd make every site identical.

I was hoping there would be some way of getting a unique identifier for each file that is independent of the filename - so regardless of where they got the content from (where it could have any filename at all), I can tell if someone uploads an already existing file. I was thinking along the lines of filesize, which perhaps could work but there could still be 2 completely different files with the same filesize, which would cause problems.

That would allow me to create a database of who has uploaded each file and give them access to it. My upload script would check for an already existing file, and if it finds one add the user to the allowed list in the database. If not, it would upload it as normal. This would allow sites to have unique content but where there is overlap, no need to duplicate the files on my server.

Many thanks for reading and I would be most grateful for any help. I hope I explained it well enough.
Link to comment
https://forums.phpfreaks.com/topic/26448-identify-files-without-using-filenames/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.