title: Get file size after downloading URL content with wget
body: <p>I'm trying to write a bash script that will download the contents of a URL (not recursive) and then analyze the file that was downloaded.</p>
  <p>If the downloaded file is a text file (i.e index.html) I want to know the size of the file and count the number of characters within that file.</p>
  <p>If the file is an image file I just want to know the file size.</p>
  <p>Right now I'm working with <code>wget</code> and downloading the contents of the input URL, but the problem is that when I do this inside my script I don't know the file name of the file that was downloaded.</p>
  <h3>So, the two main question are:</h3>
  <ol>
  <li>How can I get the filename in my script after using <code>wget</code> to perform some analyzing operations on the file?</li>
  <li>How can I deterime the file type of the downloaded file?</li>
  </ol>