Link to home
Start Free TrialLog in
Avatar of Anthony Matovu
Anthony MatovuFlag for Uganda

asked on

renaming a file during saving for the file loader

I want to rename my file during saving for the file loader. below is the code i am using

If d_FileToUpload.HasFile Then
                Try
                    If d_FileToUpload.PostedFile.ContentLength > 4000000 Then
                        Exit Sub
                    End If
                    d_FileToUpload.SaveAs(Server.MapPath("docs\" & d_FileToUpload.FileName))
               Catch ex As Exception
                End Try
            Else
             End If
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Change this line

d_FileToUpload.SaveAs(Server.MapPath("docs\" & d_FileToUpload.FileName))

to

d_FileToUpload.SaveAs(Server.MapPath("docs\MyOwnName"))
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial