Ejemplo n.º 1
0
    private void UploadFile(FileUpload fileUpload)
    {
        string fileFullName = fileUpload.PostedFile.FileName;
        string fileNameInfo = Path.GetFileName(fileFullName);
        string tempPath     = Server.MapPath("../" + uxDestinationText.Text);

        if (fileNameInfo != "" && (FileUtilities.CheckFileType(fileNameInfo, CheckType)))
        {
            PathDestination = uxDestinationText.Text;
            fileUpload.PostedFile.SaveAs(tempPath + fileNameInfo);
            PathFullName = uxDestinationText.Text + fileNameInfo;
            uxRowMessageErrorPanel.Visible = true;
            uxErrorLabel.Text = "Upload Successfully!";
        }
        else
        {
            uxErrorLabel.Text = "Can not upload file!";
            uxRowMessageErrorPanel.Visible = true;
        }
    }