Click here to Skip to main content
15,888,816 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
VB
Protected Sub SaveFile(ByVal file As HttpPostedFile)
        Dim SavePath As String = Server.MapPath("../UploadFile/")
        Dim FileName As String = File1.FileName
        Dim TempFile As String
        Dim PathToCheck As String = SavePath + FileName
        If (System.IO.File.Exists(PathToCheck)) Then
            Dim Counter As Integer = 2
            While System.IO.File.Exists(PathToCheck)
                TempFile = Counter.ToString() + FileName
                PathToCheck = SavePath + TempFile
                Counter = Counter + 1
            End While
            FileName = TempFile
            UploadStatusLabl.Text = "A Document With The Same Name Exist." + "<br/>" + _
            "Your Document Was Saved As" + FileName
        Else
            UploadStatusLabl.Text = "Your Document Was Attached Sucessfully."
        End If
        SavePath += FileName
        File1.SaveAs(SavePath)
        With acca
            .LetterAttachmentPath = SavePath
            .FileName = FileName
        End With
End Sub
Posted
Comments
OriginalGriff 14-Dec-12 3:33am    
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
I have no idea what your problem in converting it to VS2010 is - it should work without changes if the version of Visual Studio you are using is the only change you made.
Use the "Improve question" widget to edit your question and provide better information.
_Vitor Garcia_ 18-Dec-12 4:55am    
Can i copy your comment to notepad so i can use it on future commentS ? :)
BR
OriginalGriff 18-Dec-12 4:57am    
Help yourself! I keep it in a small SQLCE database with a program to copy it to the clipboard... :laugh:
_Vitor Garcia_ 18-Dec-12 4:58am    
clever friend of mine :)
ty
Akbar Ali Hussain 14-Dec-12 16:04pm    
Try first, then post your question if you face any issues.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900