Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.