This is a migrated thread and some comments may be shown as answers.

Upload File Paths

1 Answer 31 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Philip
Top achievements
Rank 1
Philip asked on 21 Aug 2009, 02:18 PM
I am trying to use the Radupload to upload files to the SQL server. The problem I am having is with the path of the file. I am using the code below. The file is trying to be located on the server instead of the client machine. How do I get the correct path so that the server can locate the file.


 

If RadUpload1.UploadedFiles.Count > 0 Then

 

 

For Each validFile As UploadedFile In RadUpload1.UploadedFiles

 

MyNcr = validFile.GetName

 

If Right(validFile.GetName, 3) = "jpg" Or Right(validFile.GetName, 3) = "JPG" Then

 

 

'validFile.SaveAs(Path.Combine("c:\", validFile.GetName()), True)

 

 

Dim fs As FileStream = New FileStream(validFile.FileName, FileMode.Open, FileAccess.Read)

 

 

Dim br As BinaryReader = New BinaryReader(fs)

 

 

photo = br.ReadBytes(System.Convert.ToInt32(fs.Length))

br.Close()

fs.Close()

 

 

 

 

1 Answer, 1 is accepted

Sort by
0
Genady Sergeev
Telerik team
answered on 21 Aug 2009, 02:36 PM
Hi Philip,

You can only access files that are on the server, in the uploaded fiels folder. ie. the path returned is the server one. There is no way to make out what was the path on the client, prior to the upload of the files.

Regards,
Genady Sergeev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Upload (Obsolete)
Asked by
Philip
Top achievements
Rank 1
Answers by
Genady Sergeev
Telerik team
Share this question
or