5 Answers, 1 is accepted
You can use the following code snippet in order to retrieve the filepath of uploaded file.
RadUpload1.UploadedFiles[0].FileName;
[The 'FileName' property returns the fully qualified name of the file on the client. (IE6 and some older browsers only). To get a file name that is the same for all browsers, use the GetName() method instead.]
-Shinu.
I have this code:
Dim filename As String = System.Guid.NewGuid().ToString.Replace("-", "0")
How do I dynamically create a folder and rename upload file using the filename variables which is a GUID?
By the way, what is the difference between Target Forlder and Physical Target Folder? Thanks
hello All
i am a fresher for telerik Contorls
I am facing a problem in using telerik control.
I have developed a small windows application. and put one RAD Grid view in a form.
when i am opening the form it is taking 5 -6 times more time as compare to other form without telerik grid. how to solve this problem
thanks in advance for your help
Suresh Kharod
I am able to create a folder dynamically but is not able to rename the file according to the new folder name.
here is my code:
Protected Sub btnUpload_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnUpload.Click
Dim filename As String = System.Guid.NewGuid().ToString.Replace("-", "0")
Dim filepath As String = "~/upload/" & filename
Directory.CreateDirectory(Server.MapPath(filepath))
For Each f As UploadedFile In RadUpload1.UploadedFiles
Dim targetFileName As String = System.IO.Path.Combine(filepath, filename & f.GetExtension)
f.SaveAs(targetFileName)
Next
End Sub
You need to change the following line:
Dim
targetFileName
As
String
= System.IO.Path.Combine(filepath, filename & f.GetExtension)
to
Dim
targetFileName
As
String
= System.IO.Path.Combine(Server.MapPath(filepath), filename & f.GetExtension)
Expect from that, everything else works correctly. I have prepared sample project that demonstrates the approach, you can find it as an attachment.
suresh kharod,
This forums is for ASP.NET controls, not for WindowsForms ones. I suggest that you navigate to this link and open a thread describing your problem there.
Sincerely yours,
Genady Sergeev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.