Prob in Document Attachment

Discussion in 'ASP.NET / ASP.NET Core' started by jesha, Feb 26, 2010.

  1. Hi,
    I have some web page where we have facility to attach document.
    I have written the code as below , and it was working properly earlier.

    But now since past few days it stopped attaching documents.
    It doesn't attach document even if its a small size like in Kb.
    this same code is working perfectly on our local machine.

    What I have done is like...on click on a button I am storing document in some folder like.. ~/IMS/Upload. and I am displaying that name of document on my web page in link Button.

    Here is my existing code :

    If lnkDownload.Text <> "" Then
    If FlUpload.HasFile = True Then
    lblError.Visible = True
    lblError.Text = "File Upload is already holding one File,Please Select Another option"
    Exit Sub
    Else
    filename = lnkDownload.Text
    End If
    Else
    If Me.FlUpload.HasFile = True Then
    Dim counter As Integer = 1
    filename = Path.GetFileName(FlUpload.FileName)
    filename = Server.MapPath("~/IMS/Upload/") + filename
    FlUpload.SaveAs(filename)
    filename = Server.UrlEncode(Path.GetFileName(FlUpload.FileName))

    lnkDownload.Visible = True
    lnkDownload.Text = filename
    Else
    filename = ""
    End If
    End If

    Can anyone plzz tell me what's wrong & why it stop working now ? or If anyone can provide a solution for this ?


    I will be very thankful.


    Jesha
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    any error?
     

Share This Page