Pls. help on a bug

vinsux

New member
Joined
Sep 11, 2012
Messages
1
Programming Experience
3-5
VB.NET:
`i just shortcut the code but it's working...
strsql = "INSERT INTO tblStudent(Picture) values (@Picture) 
 
Dim filePath As String = ofdSelectPicture.FileName


            Dim fnPeices() As String = filePath.Split("\")
            Dim fileName1 As String = ""


            fileName1 = fnPeices(fnPeices.Length - 1)
            url = fileName1




sqlcmd.Parameters.AddWithValue("@Picture", url)


please help...




i Have an bug.. i can only upload pictures from the folder of the vb.net file application.. (the sub folder named "Pictures")




i can only upload an image from that folder, and if i try to move some images to that folder.. the program still not accepting the moved pictures..


is my code right?? pleaseee.. help..


sry for bad english..
 
Hi,

From what I can see you will only ever be able to upload files from the application directory since you are removing the path to the file by using the split command.

Try NOT using the split command to upload the file from its full path and filename location.

Kind regards,

Ian
 
Back
Top