dimanche 20 août 2017

hashing content of uploaded file in php

I have a upload form where users can upload their .csv files and also a Dropzone file uploader beside it.

I want to check whether the file is new or not. the check should contain if the contents of file are new or not

I store the file names in database for checking new files, but the problem is when the user rename the same file and upload it again.

My solution is hashing the content of each file and store it beside its name in database.

but I don't know how to hash content of .csv file in php , Laravel. I've tried using

hash_file('md5' , Request::file('myFileName')->getClientOriginalName());

but it results in file or stream not found.

What is the correct way of checking the new file regardless of its name?

Thanks in advance.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2vPEipF
via IFTTT

Aucun commentaire:

Enregistrer un commentaire