private void PreviewButton_Click(object sender, EventArgs e)
        {
            if (UrlTextBox.Text != "")
            {
                UrlTextBox.ReadOnly = true;
                DownloaderWithRanges dm = new DownloaderWithRanges(UrlTextBox.Text);
                ResponseRecord record = dm.fetchFile(0, 1024 * 1024);
                Uri url = new Uri(UrlTextBox.Text);

                String tmpFileName = Application.StartupPath+ "/tmp/" + url.LocalPath;
                DownloadedFileHandler dfh = new DownloadedFileHandler();
                dfh.save(tmpFileName, record.ResponseStream);

                UrlTextBox.ReadOnly = true;

                this.Close();
                Thread.Sleep(300);
                MediaPreviewer previewer = new MediaPreviewer(tmpFileName);
                previewer.Show();

             }
        }
        private void priv_btn_Click(object sender, EventArgs e)
        {
            Uri url = new Uri(URLTextBox.Text);
            string fileName = url.LocalPath;
            ZipPreviewer.ZipPreviewer zip_preview;
            MediaPreviewer.MediaPreviewer media_preview;
            if (fileName.EndsWith(".zip", StringComparison.OrdinalIgnoreCase))
            {
                zip_preview = new ZipPreviewer.ZipPreviewer(url.ToString());
                zip_preview.Show();
            }
            else if (MediaPreviewer.MediaPreviewer.isMediaFile(fileName))
            {
                DownloaderWithRanges dm = new DownloaderWithRanges(url.ToString());
                ResponseRecord record = dm.fetchFile(0, 1024 * 1024);

                String tmpFileName = Application.StartupPath + "/tmp/" + url.LocalPath;
                DownloadedFileHandler dfh = new DownloadedFileHandler();
                dfh.save(tmpFileName, record.ResponseStream);

                Thread.Sleep(300);
                media_preview = new MediaPreviewer.MediaPreviewer(tmpFileName);
                media_preview.Show();
            }
            else
            {
                setStatusMessage("Preview is not available for" + url);
            }
        }