# Verify that a document matches a URL

Writing:

Quiet[Length[Import["http://www.africau.edu/images/default/sample.pdf"]]]


I get:

2

while writing:

Quiet[Length[Import["http://www.africau.edu/images/default/sampl.pdf"]]]


I get:

0

This is my crude method to check if a URL matches a document or not. Is there a more efficient method? Thank you!

• You can do it faster by importing the "String" import format and comparing that to the document you have – b3m2a1 May 26 at 16:55
• @b3m2a1: thanks for the answer but honestly I don't understand what you mean, could you explain me a little? – TeM May 26 at 17:18
• Use the second arg to Import – b3m2a1 May 26 at 17:40
• Fantastic, now it's definitely more efficient! Thank you! – TeM May 26 at 18:38