ntd1
asked on
Increment file name if it exists on file upload
Hi
I am creating a video uploading website. I would like to avoid having files overwitten when they have the same file name. is there a way to automatically increment the filename if it exists?
My current code is just uploading:
Thanks
'declare the file path to store uploads
Dim path As String = Server.MapPath("~/Uploaded Videos/" & UserLogin.UserNo & "/")
FileUploadVideo.PostedFile .SaveAs(pa th & FileUploadVideo.FileName)
I am creating a video uploading website. I would like to avoid having files overwitten when they have the same file name. is there a way to automatically increment the filename if it exists?
My current code is just uploading:
Thanks
'declare the file path to store uploads
Dim path As String = Server.MapPath("~/Uploaded
FileUploadVideo.PostedFile
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Very Good.
Open in new window
Personally I would generate a random string, and append it to the filename. Lemme see if I can drum up something official :)