Dear Experts and Forum Users,
I am stuck with renaming an image file type before it is actually saved to picture library. I am achieving this using a custom web part with file upload and a simple button control.
Please look at the code below (I have added comments so that it is easy for you to understand excactly what I am doing)
If FileUpload.HasFile Then
' Get extension of existing file
Dim ext as String = Path.GetExtension(FileUpload.PostedFile.FileName)
' Assign New Name - 'Test'
FileUpload.SaveAs(how to declare this path + "Test" + ext)
' Upload the Image to Picture Library
' Finally Update the Picture Library
Problems with this code
Firstly, it is not working because fileupload control method saveAs() and fileupload control method postedFile.saveAs() both require a rooted path in this case C:\inetput\images and not http:\\url\ some url pointing to picture library - how do I actually rename the file and also save it to the picture library ?
Please can you suggest a workaround for this.
View Complete Post