I have a site which copies a file from a URL to my sever. I need a way of getting a SHA of the file after it has been copied.
I was using @copy($url,$upload_path) to copy the file but this returns a boolean I need something that returns the file. Does anything like that exist?
I need to get the file afterwards for sha1_file($file)
Thank!
You can just
$upload_pathalready contains the value you would need to pass tosha1_file().And, as a general rule, the
@operator is evil. I will admit that this particular usage of it is arguably valid, but as a rule of thumb it should treated as a last resort.