upload image to server folder from windows mobile application so I can view on web app

how can i send an image stored on a wm5/6 device using vb.net to a remote server folder and then delete the file from the device
Who is Participating?
Mikal613Connect With a Mentor Commented:
To upload the file:


And delete the file


csinteraAuthor Commented:
Thanks for the quick response , I have added the following to my solution

Public Sub UploadFile(ByVal localFile As String, ByVal uploadUrl As String)
        Dim req As HttpWebRequest = CType(WebRequest.Create(uploadUrl), HttpWebRequest)
        req.Method = "PUT"
        req.AllowWriteStreamBuffering = True
        ' Retrieve request stream and wrap in StreamWriter
        Dim reqStream As Stream = req.GetRequestStream()
        Dim wrtr As StreamWriter = New StreamWriter(reqStream)
          ' Open the local file
        Dim rdr As StreamReader = New StreamReader(localFile)
          ' loop through the local file reading each line
        '  and writing to the request stream buffer
        Dim inLine As String = rdr.ReadLine()

        While Not inLine Is Nothing
            inLine = rdr.ReadLine()
        End While


    End Sub

an a  button with

UploadFile((Path.Combine(AppPath, job_no + "CapturedSignature1.bmp")), uploadurl)

do I need to do anything else as it seems to be getting stuck around the      Dim inLine As String = rdr.ReadLine() and the error message on the mobile device is

an error message cannot be displayed because an optional resource assembly containing it cannot be found

at system.IO._error.winIOerror()
at system.io.file.delete()

is the streamreader null?
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

csinteraAuthor Commented:
not sure i included this before i call the upload file

Dim value As StreamReader

        value = StreamReader.Null

is this correct ? , I also now get a different error message

did you try debugging the code?

Put a breakpoint on that line and mouse over the text. It shoud give you the value
csinteraAuthor Commented:
I get

the code called into another function, when that function has finished, this is the next statement that will be executed

System.Net.WebException was unhandled
  Message="An error message cannot be displayed because an optional resource assembly containing it cannot be found"
    at System.Net.HttpWebRequest.finishGetResponse()
    at System.Net.HttpWebRequest.GetResponse()
    at kmhpda.custSig.UploadFile()
    at kmhpda.custSig.btnSave_Click()
    at System.Windows.Forms.Control.OnClick()
    at System.Windows.Forms.Button.OnClick()
    at System.Windows.Forms.ButtonBase.WnProc()
    at System.Windows.Forms.Control._InternalWnProc()
    at Microsoft.AGL.Forms.EVL.EnterMainLoop()
    at System.Windows.Forms.Application.Run()
    at kmhpda.custSig.Main()
csinteraAuthor Commented:
any help on this is very much welcome
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.