Click here to Skip to main content
15,915,019 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Comboboxes in Datagrid view Pin
Richard MacCutchan9-Dec-09 23:22
mveRichard MacCutchan9-Dec-09 23:22 
GeneralRe: Comboboxes in Datagrid view Pin
EvanSaunders9-Dec-09 23:27
EvanSaunders9-Dec-09 23:27 
QuestionProcess.start wait for a callback Pin
coolpjmartin9-Dec-09 0:47
coolpjmartin9-Dec-09 0:47 
AnswerRe: Process.start wait for a callback Pin
nlarson119-Dec-09 3:44
nlarson119-Dec-09 3:44 
QuestionRe: Process.start wait for a callback Pin
richardw489-Dec-09 5:51
richardw489-Dec-09 5:51 
AnswerRe: Process.start wait for a callback Pin
Alan N9-Dec-09 7:25
Alan N9-Dec-09 7:25 
GeneralRe: Process.start wait for a callback Pin
coolpjmartin18-Dec-09 6:01
coolpjmartin18-Dec-09 6:01 
QuestionImage not uploading Pin
dcdhingra9-Dec-09 0:32
dcdhingra9-Dec-09 0:32 
Hi,

I am developing a vb.net application in which i uploading some paramenters which is given below "FirstName,MiddleName,LastName,MyImage".

Uploading is done successfully but image is not showing at webpage. It is uploading FirstName, MiddleName, LastName not Myimage.

My Code is below:

myUri = New Uri("https://www.mysite.com/apis/CreateMyContact.cfm")

data = data.Append("&FirstName=" & System.Web.HttpUtility.UrlEncode(Dharm))

data = data.Append("&MiddleName=" & System.Web.HttpUtility.UrlEncode(Chand))

data = data.Append("&LastName=" & System.Web.HttpUtility.UrlEncode(Dhingra))

data = data.Append("&NickName=" & System.Web.HttpUtility.UrlEncode(Dharmu))

Dim fs As System.IO.FileStream = Nothing
Dim imgByte() As Byte = Nothing
Try
fs = System.IO.File.Open(image_path, IO.FileMode.Open, FileAccess.Read)

ReDim imgByte(fs.Length)
fs.Read(imgByte, 0, fs.Length)
fs.Close()
fs.Dispose()
fs = Nothing

Catch ex As System.Exception

End Try

If Not IsNothing(imgByte) Then
data = data.Append("&PhotoBinary=" & System.Web.HttpUtility.UrlEncode(imgByte)) 'image_path)) '

End If

'Create a byte array of the data we want to send
Dim requestBytes As Byte() = System.Text.UTF8Encoding.UTF8.GetBytes(data.ToString())

Dim oWeb As New System.Net.WebClient()

oWeb.Headers.Add("Content-Type", "application/x-www-form-urlencoded")

Try
Dim bytRetData As Byte() = oWeb.UploadData(myUri, "POST", requestBytes)
Catch ex As WebException
End Try

This code is working successfully but image is not uploading.
Please guide me if i did wrong something in code.

Regards
Dharmchand dhingra
AnswerRe: Image not uploading Pin
Dave Kreskowiak9-Dec-09 4:39
mveDave Kreskowiak9-Dec-09 4:39 
GeneralRe: Image not uploading Pin
dcdhingra13-Dec-09 7:09
dcdhingra13-Dec-09 7:09 
QuestionDate formate in VB .net. Pin
jeshra2798-Dec-09 21:14
jeshra2798-Dec-09 21:14 
AnswerRe: Date formate in VB .net. Pin
Ashfield8-Dec-09 21:41
Ashfield8-Dec-09 21:41 
GeneralRe: Date formate in VB .net. Pin
jeshra2798-Dec-09 21:48
jeshra2798-Dec-09 21:48 
GeneralRe: Date formate in VB .net. Pin
Richard MacCutchan8-Dec-09 22:38
mveRichard MacCutchan8-Dec-09 22:38 
GeneralRe: Date formate in VB .net. Pin
jeshra2799-Dec-09 0:27
jeshra2799-Dec-09 0:27 
GeneralRe: Date formate in VB .net. Pin
Richard MacCutchan9-Dec-09 0:38
mveRichard MacCutchan9-Dec-09 0:38 
GeneralRe: Date formate in VB .net. Pin
Ashfield9-Dec-09 1:14
Ashfield9-Dec-09 1:14 
GeneralRe: Date formate in VB .net. Pin
David Skelly9-Dec-09 2:03
David Skelly9-Dec-09 2:03 
AnswerRe: Date formate in VB .net. Pin
Luc Pattyn9-Dec-09 3:18
sitebuilderLuc Pattyn9-Dec-09 3:18 
GeneralRe: Date formate in VB .net. Pin
jeshra2799-Dec-09 3:43
jeshra2799-Dec-09 3:43 
GeneralRe: Date formate in VB .net. Pin
Luc Pattyn9-Dec-09 3:52
sitebuilderLuc Pattyn9-Dec-09 3:52 
GeneralRe: Date formate in VB .net. Pin
richardw489-Dec-09 6:00
richardw489-Dec-09 6:00 
QuestionRandom Acces file (FileGet QUESTION) [modified] Pin
PAguilar098-Dec-09 20:52
PAguilar098-Dec-09 20:52 
AnswerRe: Random Acces file (FileGet QUESTION) Pin
Dave Kreskowiak9-Dec-09 5:55
mveDave Kreskowiak9-Dec-09 5:55 
GeneralRe: Random Acces file (FileGet QUESTION) Pin
PAguilar099-Dec-09 6:29
PAguilar099-Dec-09 6:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.