Last post Feb 11, 2011 05:09 PM by haggis999
Feb 11, 2011 03:21 PM|haggis999|LINK
I want to create VB.NET code that will change the filename of selected image files that are already stored on my ISP's web server. I know how to do this by reading the image into memory and then saving it as a new file. However, I would prefer not to regenerate
the image. I just want to change the filename. Is this possible?
Feb 11, 2011 04:20 PM|p3tar|LINK
Maybe this code could help:
Public Sub RenameFile(ByVal oldFileName As String, ByVal newFileName As String)
Dim path As String = (Server.MapPath("~") + "\\YOUR_FILES_FOLDER\\")
Dim fromFile As String = (path + oldFileName)
Dim tofile As String = (path + newFileName)
Feb 11, 2011 05:09 PM|haggis999|LINK
Thanks. That code works perfectly.