Jump to content

File allocation advice


spewperb

Recommended Posts

Hi everyone,

 

I'm revising a programme I wrote a few years ago for assigning uploaded files to users. Currently when an administrator logs on to assign a file to a client, a script loops through all the files in the 'uploads' directory and cross references them against a database using the files name and path as a key. This works fine however if someone amends a file and uploads it the the same directory with the same name the script assumes that it is already assigned. I was thinking about using and md5 checksum as the key. Is this a good idea? It would have to checksum several thousand video files. Can anyone think of a better way of doing this?

 

Cheers

Link to comment
https://forums.phpfreaks.com/topic/135479-file-allocation-advice/
Share on other sites

That is sort of what its doing. Files are uploaded using a ftp client (uploads not handled by the script) and sit waiting to be assigned. When a file is assigned its path is then added to the database. If you delete a file and replace it with one with an identical name the script cant tell when it does the lookup.

That is sort of what its doing. Files are uploaded using a ftp client (uploads not handled by the script) and sit waiting to be assigned. When a file is assigned its path is then added to the database. If you delete a file and replace it with one with an identical name the script cant tell when it does the lookup.

 

Sounds like an ftp flaw/human error. You cannot really account for that unless you had some script that could tell when a file was manipulated to that directory and when it is it alerts the database that x has been deleted or b has been uploaded.

 

The only way to do that, which I know of, would be to constantly parse the ftp logs, which would be a huge resource hog.

 

I think you are stuck between a rock and a hard spot here.

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.