0

I am actually trying to add a working option into my Listener that should do the following:

It should check my database and the row "filedata" because my users have a file stored in here thats most likely unique I want to add an option that checks the database if a file is more than once there and notifies my user that his file is being used by another Person as well.

If any of you could help me I'd really appreciate that!

Timothy
  • 2,004
  • 3
  • 23
  • 29
ExtSynth
  • 1
  • 1
  • Listener? Event Listener? What have you tried? What doesn't work? – jleach Aug 06 '16 at 20:50
  • It is my main Listener console thats constantly running. I havent tried this as of now, i am unsure how this works. Thats why im asking here. :-) – ExtSynth Aug 06 '16 at 20:59
  • so you only want to check and see if you have a file in your table or not?! – Ashkan S Aug 06 '16 at 21:35
  • You won't be able to compare1 file with your whole table, because comparing 2 large fields is very time consuming, but you can check for the name, size, creation date and other file properties to determine if they have similar properties and based on that determine if the file is similar or not – Ashkan S Aug 06 '16 at 21:37
  • 1
    Is it possible to check like the hash of the files? – ExtSynth Aug 06 '16 at 21:45
  • 1
    @ExtSynth - file hashes, sure, as long as you catch the incoming file before it gets stored in the db. Upon storage, have your app work up an MD5 checksum, store it in a separate field (this keeps you from having to regenerate for all files to compare), then when this listener gets another file, generate *that* file's MD5, and search the field in the table for an existing: http://stackoverflow.com/questions/10520048/calculate-md5-checksum-for-a-file – jleach Aug 07 '16 at 00:30

0 Answers0