protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                //get file path
                string path = Encoding.UTF8.GetString(Convert.FromBase64String(Request.QueryString["f"]));

                //the type of request
                string type = "application/octet-stream";

                //if request isn't null...
                if (!(Request.QueryString["type"] == null))
                {
                    //if request is of type view...
                    if (Request.QueryString["type"] == "view")
                    {
                        //the file extention
                        string extension = System.IO.Path.GetExtension(System.IO.Path.GetFileName(path));
                        switch (extension)
                        {
                        case ".pdf":
                            type = "Application/pdf";
                            break;

                        case ".jpg":
                        case ".jpeg":
                            type = "image/jpeg";
                            break;

                        case ".png":
                            type = "image/png";
                            break;

                        case ".txt":
                            type = "text/plain";
                            break;

                        case ".doc":
                        case ".docx":
                            type = "Application/msword";
                            break;

                        case ".xls":
                        case ".xlsx":
                            type = "Application/msexcel";
                            break;

                        default:
                            type = "application/octet-stream";
                            break;
                        }
                    }
                }
                mysql qery = new mysql();
                qery.RecordFileAccess(path);
                download_file(System.IO.Path.GetFileName(path), path, type);
            }
            catch (Exception ex)
            {
            }
        }